@@ -312,20 +312,20 @@ def test_expand_modules_with_ignore(
312
312
assert not errors
313
313
314
314
315
- def test_discover_package_path_no_source_root_overlap (tmp_path ) :
315
+ def test_discover_package_path_no_source_root_overlap (tmp_path : Path ) -> None :
316
316
"""Test whether source_roots is returned even if module doesn't overlap
317
317
with source_roots
318
318
"""
319
- source_roots = [tmp_path ]
319
+ source_roots = [str ( tmp_path ) ]
320
320
package_paths = discover_package_path (__file__ , source_roots )
321
321
322
322
expected = source_roots
323
323
assert package_paths == expected
324
324
325
325
326
- def test_discover_package_path_legacy ():
326
+ def test_discover_package_path_legacy () -> None :
327
327
"""Test for legacy path discovery when source_roots is empty"""
328
- source_roots = []
328
+ source_roots : list [ str ] = []
329
329
package_paths = discover_package_path (__file__ , source_roots )
330
330
331
331
# First ancestor directory without __init__.py
@@ -334,16 +334,18 @@ def test_discover_package_path_legacy():
334
334
assert package_paths == expected
335
335
336
336
337
- def test_discover_package_path_legacy_no_parent_without_init_py (tmp_path , monkeypatch ):
337
+ def test_discover_package_path_legacy_no_parent_without_init_py (
338
+ tmp_path : Path , monkeypatch : pytest .MonkeyPatch
339
+ ) -> None :
338
340
"""Test to return current directory if no parent directory without
339
341
__init__.py is found
340
342
"""
341
- source_roots = []
343
+ source_roots : list [ str ] = []
342
344
343
345
monkeypatch .setattr (os .path , "exists" , lambda path : True )
344
346
monkeypatch .setattr (os .path , "dirname" , lambda path : path )
345
347
346
- package_paths = discover_package_path (tmp_path , source_roots )
348
+ package_paths = discover_package_path (str ( tmp_path ) , source_roots )
347
349
348
350
expected = [os .getcwd ()]
349
351
0 commit comments