1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
"""
Shared pytest fixtures and utilities for test modules.
Provides common testing utilities that can be reused across multiple test files.
"""
# Ensure `scripts/` is on sys.path for test imports
# This must be done before importing any local modules
= .
"""
Pytest fixture for temporarily changing working directory.
Returns a context manager that can be used to change directories
and automatically restore the original directory.
Usage:
def test_something(temp_chdir):
with temp_chdir(some_path):
# Code that runs in some_path
pass
# Back to original directory
"""
"""Context manager for temporarily changing working directory."""
=
=
yield
return
"""
Pytest fixture for creating mock CompletedProcess objects for git commands.
Returns a function that creates a mock object with the specified stdout output.
This standardizes git command mocking across all test files.
Usage:
def test_something(mock_git_command_result):
mock_result = mock_git_command_result("v0.4.2")
# mock_result.stdout.strip() will return "v0.4.2"
"""
"""Create a mock CompletedProcess object for git commands."""
=
= # mimic CompletedProcess.stdout (str)
= 0
=
return
return