You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardexpand all lines: notes/proposals/03-testing-system.md
+43-24
Original file line number
Diff line number
Diff line change
@@ -1,6 +1,6 @@
1
1
# Testing System Proposal
2
2
3
-
> Enhancing the testing infrastructure to improve maintainability, coverage, and developer experience.
3
+
> Enhancing the testing infrastructure to improve maintainability, coverage, and developer experience using argparse with Python 3.9+ typing and shtab support.
4
4
5
5
## Current Issues
6
6
@@ -64,6 +64,7 @@ The audit identified several issues with the current testing system:
64
64
1.**Centralized Fixtures**:
65
65
```python
66
66
# tests/conftest.py
67
+
import typing as t
67
68
import pytest
68
69
from pathlib import Path
69
70
import tempfile
@@ -74,7 +75,7 @@ The audit identified several issues with the current testing system:
74
75
"""Create a temporary directory for testing.
75
76
76
77
Returns
77
-
-------
78
+
----
78
79
Path
79
80
Path to temporary directory
80
81
"""
@@ -86,12 +87,12 @@ The audit identified several issues with the current testing system:
86
87
"""Create a sample configuration file.
87
88
88
89
Parameters
89
-
----------
90
+
----
90
91
temp_dir : Path
91
92
Temporary directory fixture
92
93
93
94
Returns
94
-
-------
95
+
----
95
96
Path
96
97
Path to sample configuration file
97
98
"""
@@ -111,6 +112,7 @@ The audit identified several issues with the current testing system:
111
112
2.**Factory Fixtures**:
112
113
```python
113
114
# tests/conftest.py
115
+
import typing as t
114
116
import pytest
115
117
from vcspull.config.models import Repository, VCSPullConfig
116
118
from pathlib import Path
@@ -120,7 +122,7 @@ The audit identified several issues with the current testing system:
120
122
"""Factory fixture to create Repository instances.
121
123
122
124
Returns
123
-
-------
125
+
----
124
126
Callable
125
127
Function to create repositories
126
128
"""
@@ -137,7 +139,7 @@ The audit identified several issues with the current testing system:
137
139
"""Factory fixture to create VCSPullConfig instances.
138
140
139
141
Returns
140
-
-------
142
+
----
141
143
Callable
142
144
Function to create configurations
143
145
"""
@@ -156,6 +158,7 @@ The audit identified several issues with the current testing system:
156
158
1.**Isolated Filesystem Operations**:
157
159
```python
158
160
# tests/unit/vcspull/config/test_loader.py
161
+
import typing as t
159
162
import pytest
160
163
from pathlib import Path
161
164
@@ -165,7 +168,7 @@ The audit identified several issues with the current testing system:
165
168
"""Test loading configuration from a file.
166
169
167
170
Parameters
168
-
----------
171
+
----
169
172
temp_dir : Path
170
173
Temporary directory fixture
171
174
"""
@@ -186,6 +189,7 @@ The audit identified several issues with the current testing system:
186
189
2.**Environment Variable Isolation**:
187
190
```python
188
191
# tests/unit/vcspull/config/test_loader.py
192
+
import typing as t
189
193
import pytest
190
194
import os
191
195
@@ -195,7 +199,7 @@ The audit identified several issues with the current testing system:
195
199
"""Test loading configuration from environment variables.
196
200
197
201
Parameters
198
-
----------
202
+
----
199
203
monkeypatch : pytest.MonkeyPatch
200
204
Pytest monkeypatch fixture
201
205
temp_dir : Path
@@ -227,6 +231,7 @@ The audit identified several issues with the current testing system:
227
231
1.**Configuration Data Generators**:
228
232
```python
229
233
# tests/strategies.py
234
+
import typing as t
230
235
from hypothesis import strategies as st
231
236
from pathlib import Path
232
237
@@ -261,6 +266,7 @@ The audit identified several issues with the current testing system:
261
266
2.**Testing Invariants**:
262
267
```python
263
268
# tests/unit/vcspull/config/test_validation.py
269
+
import typing as t
264
270
import pytest
265
271
from hypothesis import given, strategies as st
266
272
@@ -272,7 +278,7 @@ The audit identified several issues with the current testing system:
272
278
"""Test that config serialization and deserialization preserves data.
273
279
274
280
Parameters
275
-
----------
281
+
----
276
282
config_data : dict
277
283
Generated configuration data
278
284
"""
@@ -304,22 +310,25 @@ The audit identified several issues with the current testing system:
0 commit comments