Skip to content

Commit 8135bf0

Browse files
committed
Add modulefinder unit test
1 parent c6e8a0b commit 8135bf0

File tree

6 files changed

+12
-0
lines changed

6 files changed

+12
-0
lines changed

mypy/test/testmodulefinder.py

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -184,6 +184,12 @@ def test__packages_with_ns(self) -> None:
184184
("ns_pkg_untyped.b.c", ModuleNotFoundReason.FOUND_WITHOUT_TYPE_HINTS),
185185
("ns_pkg_untyped.a.a_var", ModuleNotFoundReason.FOUND_WITHOUT_TYPE_HINTS),
186186

187+
# Namespace package without stub package
188+
("ns_pkg_w_stubs", self.path("ns_pkg_w_stubs")),
189+
("ns_pkg_w_stubs.typed", self.path("ns_pkg_w_stubs-stubs", "typed", "__init__.pyi")),
190+
("ns_pkg_w_stubs.typed_inline", self.path("ns_pkg_w_stubs", "typed_inline", "__init__.py")),
191+
("ns_pkg_w_stubs.untyped", ModuleNotFoundReason.FOUND_WITHOUT_TYPE_HINTS),
192+
187193
# Regular package with py.typed
188194
("pkg_typed", self.path("pkg_typed", "__init__.py")),
189195
("pkg_typed.a", self.path("pkg_typed", "a.py")),
@@ -239,6 +245,12 @@ def test__packages_without_ns(self) -> None:
239245
("ns_pkg_untyped.b.c", ModuleNotFoundReason.FOUND_WITHOUT_TYPE_HINTS),
240246
("ns_pkg_untyped.a.a_var", ModuleNotFoundReason.FOUND_WITHOUT_TYPE_HINTS),
241247

248+
# Namespace package without stub package
249+
("ns_pkg_w_stubs", ModuleNotFoundReason.FOUND_WITHOUT_TYPE_HINTS),
250+
("ns_pkg_w_stubs.typed", ModuleNotFoundReason.FOUND_WITHOUT_TYPE_HINTS),
251+
("ns_pkg_w_stubs.typed_inline", self.path("ns_pkg_w_stubs", "typed_inline", "__init__.py")),
252+
("ns_pkg_w_stubs.untyped", ModuleNotFoundReason.FOUND_WITHOUT_TYPE_HINTS),
253+
242254
# Regular package with py.typed
243255
("pkg_typed", self.path("pkg_typed", "__init__.py")),
244256
("pkg_typed.a", self.path("pkg_typed", "a.py")),

test-data/packages/modulefinder-site-packages/ns_pkg_w_stubs-stubs/typed/__init__.pyi

Whitespace-only changes.

test-data/packages/modulefinder-site-packages/ns_pkg_w_stubs/typed/__init__.py

Whitespace-only changes.

test-data/packages/modulefinder-site-packages/ns_pkg_w_stubs/typed_inline/__init__.py

Whitespace-only changes.

test-data/packages/modulefinder-site-packages/ns_pkg_w_stubs/typed_inline/py.typed

Whitespace-only changes.

test-data/packages/modulefinder-site-packages/ns_pkg_w_stubs/untyped/__init__.py

Whitespace-only changes.

0 commit comments

Comments
 (0)