diff options
| author | Daniƫl van Noord <13665637+DanielNoord@users.noreply.github.com> | 2021-12-16 12:16:20 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2021-12-16 12:16:20 +0100 |
| commit | dddf2daaa95754772ebf8a84fb25cd689c98736e (patch) | |
| tree | f6b60ea3591e3739227f75b0b1aa1e23f52e80b2 /tests | |
| parent | e3730a7aaf35030edcafbb5ec0509fb8ff070e33 (diff) | |
| download | astroid-git-dddf2daaa95754772ebf8a84fb25cd689c98736e.tar.gz | |
Make Module call the __init__ of NodeNG (#1262)
Co-authored-by: Marc Mueller <30130371+cdce8p@users.noreply.github.com>
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/unittest_nodes_lineno.py | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/tests/unittest_nodes_lineno.py b/tests/unittest_nodes_lineno.py index 75d664dc..73cf0207 100644 --- a/tests/unittest_nodes_lineno.py +++ b/tests/unittest_nodes_lineno.py @@ -2,6 +2,7 @@ import textwrap import pytest +import astroid from astroid import builder, nodes from astroid.const import PY38_PLUS, PY39_PLUS, PY310_PLUS @@ -1221,3 +1222,14 @@ class TestLinenoColOffset: assert (c1.body[0].lineno, c1.body[0].col_offset) == (4, 4) assert (c1.body[0].end_lineno, c1.body[0].end_col_offset) == (4, 8) # fmt: on + + @staticmethod + def test_end_lineno_module() -> None: + """Tests for Module""" + code = """print()""" + module = astroid.parse(code) + assert isinstance(module, nodes.Module) + assert module.lineno == 0 + assert module.col_offset is None + assert module.end_lineno is None + assert module.end_col_offset is None |
