Skip to content

Commit c2492e8

Browse files
committed
Add modulefinder unit test
1 parent c6e8a0b commit c2492e8

File tree

6 files changed

+14
-0
lines changed

6 files changed

+14
-0
lines changed

mypy/test/testmodulefinder.py

+14
Original file line numberDiff line numberDiff line change
@@ -184,6 +184,13 @@ 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",
191+
self.path("ns_pkg_w_stubs", "typed_inline", "__init__.py")),
192+
("ns_pkg_w_stubs.untyped", ModuleNotFoundReason.FOUND_WITHOUT_TYPE_HINTS),
193+
187194
# Regular package with py.typed
188195
("pkg_typed", self.path("pkg_typed", "__init__.py")),
189196
("pkg_typed.a", self.path("pkg_typed", "a.py")),
@@ -239,6 +246,13 @@ def test__packages_without_ns(self) -> None:
239246
("ns_pkg_untyped.b.c", ModuleNotFoundReason.FOUND_WITHOUT_TYPE_HINTS),
240247
("ns_pkg_untyped.a.a_var", ModuleNotFoundReason.FOUND_WITHOUT_TYPE_HINTS),
241248

249+
# Namespace package without stub package
250+
("ns_pkg_w_stubs", ModuleNotFoundReason.FOUND_WITHOUT_TYPE_HINTS),
251+
("ns_pkg_w_stubs.typed", ModuleNotFoundReason.FOUND_WITHOUT_TYPE_HINTS),
252+
("ns_pkg_w_stubs.typed_inline",
253+
self.path("ns_pkg_w_stubs", "typed_inline", "__init__.py")),
254+
("ns_pkg_w_stubs.untyped", ModuleNotFoundReason.FOUND_WITHOUT_TYPE_HINTS),
255+
242256
# Regular package with py.typed
243257
("pkg_typed", self.path("pkg_typed", "__init__.py")),
244258
("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)