diff options
| author | Daniƫl van Noord <13665637+DanielNoord@users.noreply.github.com> | 2022-08-25 11:28:59 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2022-08-25 11:28:59 +0200 |
| commit | 998ff34b5e7aa20eca7e3d9d438f15d500f9510b (patch) | |
| tree | 13cb1e7a3edf89964aff82ec57b485b8eef07465 /tests | |
| parent | ddfba9c583287436f1c3498cb9f5fd919fb33ed0 (diff) | |
| download | astroid-git-998ff34b5e7aa20eca7e3d9d438f15d500f9510b.tar.gz | |
Fix crash involving non-standard type comments (#1753)
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/unittest_builder.py | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/tests/unittest_builder.py b/tests/unittest_builder.py index 61ef1bba..cc1cb28b 100644 --- a/tests/unittest_builder.py +++ b/tests/unittest_builder.py @@ -737,6 +737,14 @@ class BuilderTest(unittest.TestCase): self.assertIsInstance(inferred, nodes.Const) self.assertEqual(inferred.value, NotImplemented) + def test_type_comments_without_content(self) -> None: + node = builder.parse( + """ + a = 1 # type: # any comment + """ + ) + assert node + class FileBuildTest(unittest.TestCase): def setUp(self) -> None: |
