Skip to content

Commit e083e5c

Browse files
committed
Add explicit test with Iterable that is not a Sequence for __all__
1 parent 3139f49 commit e083e5c

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

test-data/unit/check-modules.test

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -433,6 +433,13 @@ __all__ = 1 # E: Type of __all__ must be "Sequence[str]", not "int"
433433
reveal_type(__all__) # N: Revealed type is "builtins.int"
434434
[builtins fixtures/module_all.pyi]
435435

436+
[case testAllMustBeSequenceStr3]
437+
import typing
438+
__all__ = set() # E: Need type annotation for "__all__" (hint: "__all__: set[<type>] = ...") \
439+
# E: Type of __all__ must be "Sequence[str]", not "set[Any]"
440+
reveal_type(__all__) # N: Revealed type is "builtins.set[Any]"
441+
[builtins fixtures/set.pyi]
442+
436443
[case testModuleAllEmptyList]
437444
__all__ = []
438445
reveal_type(__all__) # N: Revealed type is "builtins.list[builtins.str]"

0 commit comments

Comments
 (0)