Skip to content

Commit 6ef3156

Browse files
committed
Fix mypy errors
1 parent c823055 commit 6ef3156

File tree

1 file changed

+9
-7
lines changed

1 file changed

+9
-7
lines changed

tests/lint/unittest_expand_modules.py

+9-7
Original file line numberDiff line numberDiff line change
@@ -312,20 +312,20 @@ def test_expand_modules_with_ignore(
312312
assert not errors
313313

314314

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:
316316
"""Test whether source_roots is returned even if module doesn't overlap
317317
with source_roots
318318
"""
319-
source_roots = [tmp_path]
319+
source_roots = [str(tmp_path)]
320320
package_paths = discover_package_path(__file__, source_roots)
321321

322322
expected = source_roots
323323
assert package_paths == expected
324324

325325

326-
def test_discover_package_path_legacy():
326+
def test_discover_package_path_legacy() -> None:
327327
"""Test for legacy path discovery when source_roots is empty"""
328-
source_roots = []
328+
source_roots: list[str] = []
329329
package_paths = discover_package_path(__file__, source_roots)
330330

331331
# First ancestor directory without __init__.py
@@ -334,16 +334,18 @@ def test_discover_package_path_legacy():
334334
assert package_paths == expected
335335

336336

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:
338340
"""Test to return current directory if no parent directory without
339341
__init__.py is found
340342
"""
341-
source_roots = []
343+
source_roots: list[str] = []
342344

343345
monkeypatch.setattr(os.path, "exists", lambda path: True)
344346
monkeypatch.setattr(os.path, "dirname", lambda path: path)
345347

346-
package_paths = discover_package_path(tmp_path, source_roots)
348+
package_paths = discover_package_path(str(tmp_path), source_roots)
347349

348350
expected = [os.getcwd()]
349351

0 commit comments

Comments
 (0)