8000 add a test · python/mypy@f49ceda · GitHub
[go: up one dir, main page]

Skip to content

Commit f49ceda

Browse files
author
hauntsaninja
committed
add a test
1 parent 5c6d763 commit f49ceda

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

test-data/unit/check-errorcodes.test

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -841,11 +841,15 @@ if good_union:
841841
bad_union: Union[Foo, object] = Foo()
842842
if bad_union: # E: "__main__.bad_union" has type "Union[__main__.Foo, builtins.object]" of which no members implement 8CB0 __bool__ or __len__ so it could always be true in boolean context [truthy-bool]
843843
pass
844+
if not bad_union:
845+
pass
844846

845847
def f():
846848
pass
847849
if f: # E: Function "def () -> Any" could always be true in boolean context [truthy-bool]
848850
pass
851+
if not f:
852+
pass
849853
conditional_result = 'foo' if f else 'bar' # E: Function "def () -> Any" could always be true in boolean context [truthy-bool]
850854

851855
lst: List[int] = []

0 commit comments

Comments
 (0)
0