@@ -161,12 +161,18 @@ def test_filter_fnmatch_pattern(tmp_path: Path, capsys: CaptureFixture[str], run
161
161
write_config (tmp_path , runner , pattern = "'**/*.rst'" )
162
162
results = run (capsys , runner , tmp_path )
163
163
# The fact that the two .rst files in the root aren't matched is
164
- # arguably a bug in the Python interpretation of **/
164
+ # arguably a bug in the Python interpretation of **/ in Python < 3.13
165
+ expected_total = 4
165
166
results .out .assert_has_run (runner , '/parent/foo.rst' )
166
167
results .out .assert_has_run (runner , '/parent/bar.rst' )
167
168
results .out .assert_has_run (runner , '/parent/child/foo.rst' )
168
169
results .out .assert_has_run (runner , '/parent/child/bar.rst' )
169
- assert results .total == 4 , results .out .text
170
+ # The interpretation of **/ was fixed in Python 3.13
171
+ if sys .version_info >= (3 , 13 ):
172
+ expected_total = 6
173
+ results .out .assert_has_run (runner , '/foo.rst' )
174
+ results .out .assert_has_run (runner , '/bar.rst' )
175
+ assert results .total == expected_total , results .out .text
170
176
171
177
172
178
@pytest .mark .parametrize ('runner' , [PYTEST , UNITTEST ])
@@ -211,10 +217,11 @@ def test_filter_directory_with_excludes(tmp_path: Path, capsys: CaptureFixture[s
211
217
@pytest .mark .parametrize ('runner' , [PYTEST , UNITTEST ])
212
218
def test_filter_filenames_and_excludes (tmp_path : Path , capsys : CaptureFixture [str ], runner : str ):
213
219
make_tree (tmp_path )
220
+ globber = "**/" if sys .version_info >= (3 , 13 ) else "**"
214
221
write_config (tmp_path , runner ,
215
222
path = f"'{ tmp_path / 'parent' } '" ,
216
223
filenames = "{'bar.rst'}" ,
217
- excludes = "['** child/*.rst']" )
224
+ excludes = f "['{ globber } child/*.rst']" )
218
225
results = run (capsys , runner , tmp_path )
219
226
results .out .assert_has_run (runner , '/parent/bar.rst' )
220
227
assert results .total == 1 , results .out .text
0 commit comments