From cc4f62e9a711ba267a44b71577fa180204d5c2c2 Mon Sep 17 00:00:00 2001 From: anthony sottile Date: Tue, 22 Sep 2026 15:33:15 -0400 Subject: [PATCH] add test for failed docstring parsing --- pyflakes/test/test_doctests.py | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/pyflakes/test/test_doctests.py b/pyflakes/test/test_doctests.py index b6dfe629..0451cfd9 100644 --- a/pyflakes/test/test_doctests.py +++ b/pyflakes/test/test_doctests.py @@ -431,6 +431,18 @@ def doctest_stuff(): ''' """, m.UnusedImport) + def test_malformed_doctest_ignored(self): + self.flakes(""" + def f(): + '''my docstring + + >>> hello + ... + ... + >>> world + ''' + """) + class TestOther(_DoctestMixin, TestOther): """Run TestOther with each test wrapped in a doctest."""