From 39b180337df8b7f95a01d25e403dacf7e5410fa0 Mon Sep 17 00:00:00 2001 From: sobolevn Date: Thu, 24 Aug 2023 11:01:03 +0300 Subject: [PATCH] Add more tests --- test-data/unit/check-errorcodes.test | 3 +++ 1 file changed, 3 insertions(+) diff --git a/test-data/unit/check-errorcodes.test b/test-data/unit/check-errorcodes.test index 55b7a49a3111..4b57358d3cbb 100644 --- a/test-data/unit/check-errorcodes.test +++ b/test-data/unit/check-errorcodes.test @@ -895,6 +895,9 @@ if any_or_object: if (my_foo := Foo()): # E: "__main__.my_foo" has type "Foo" which does not implement __bool__ or __len__ so it could always be true in boolean context [truthy-bool] pass + +if my_a := (a or Foo()): # E: "__main__.Foo" returns "Foo" which does not implement __bool__ or __len__ so it could always be true in boolean context [truthy-bool] + pass [builtins fixtures/list.pyi] [case testTruthyFunctions]