Skip to content

Commit 02b4f14

Browse files
committed
Only test the contents of __all__, not the presence
1 parent 2f06a77 commit 02b4f14

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

mypy/stubtest.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -316,7 +316,7 @@ def _belongs_to_runtime(r: types.ModuleType, attr: str) -> bool:
316316
return not isinstance(obj, types.ModuleType)
317317

318318
runtime_public_contents = (
319-
runtime_all_as_set | {"__all__"}
319+
runtime_all_as_set
320320
if runtime_all_as_set is not None
321321
else {
322322
m

mypy/test/teststubtest.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -934,7 +934,7 @@ def test_all_at_runtime_not_stub(self) -> Iterator[Case]:
934934
runtime="""
935935
__all__ = []
936936
Z = 5""",
937-
error="__all__",
937+
error=None,
938938
)
939939

940940
@collect_cases
@@ -974,7 +974,7 @@ def h(x: str): ...
974974
runtime="",
975975
error="h",
976976
)
977-
yield Case(stub="", runtime="__all__ = []", error="__all__") # dummy case
977+
yield Case(stub="", runtime="__all__ = []", error=None) # dummy case
978978
yield Case(stub="", runtime="__all__ += ['y']\ny = 5", error="y")
979979
yield Case(stub="", runtime="__all__ += ['g']\ndef g(): pass", error="g")
980980
# Here we should only check that runtime has B, since the stub explicitly re-exports it

0 commit comments

Comments
 (0)