From 8a921a4d24fe7cbb49af0d4ed0c32fd32458e40d Mon Sep 17 00:00:00 2001 From: Niklas Mertsch Date: Fri, 30 Aug 2024 20:49:46 +0200 Subject: [PATCH] fixup! Add test cases for #14209 --- test-data/unit/check-possibly-undefined.test | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/test-data/unit/check-possibly-undefined.test b/test-data/unit/check-possibly-undefined.test index a88fec1cccd14..6bb5b44c9379c 100644 --- a/test-data/unit/check-possibly-undefined.test +++ b/test-data/unit/check-possibly-undefined.test @@ -1059,7 +1059,10 @@ b # OK [case testForLoopBreakElseException] # flags: --enable-error-code possibly-undefined # Regression test for https://github.com/python/mypy/issues/14209 -for i in [1, 2, 3]: +class Iterable: + def __iter__(self): ... + +for i in Iterable(): if i: b = i break