diff options
author | Marc Mueller <30130371+cdce8p@users.noreply.github.com> | 2023-04-25 19:10:48 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-04-25 17:10:48 +0000 |
commit | 08ed4136d83ba88d1e605e4afad71a5420396eec (patch) | |
tree | 5e0094640d1514537e80def524b9f1bd4694aae5 /tests | |
parent | 6865b2b04a22ccee4a34016520e667d5e517740d (diff) | |
download | astroid-git-08ed4136d83ba88d1e605e4afad71a5420396eec.tar.gz |
Remove deprecated `is_sys_guard` + `is_typing_guard` (#2153)
Co-authored-by: Pierre Sassoulas <pierre.sassoulas@gmail.com>
Co-authored-by: Daniƫl van Noord <13665637+DanielNoord@users.noreply.github.com>
Diffstat (limited to 'tests')
-rw-r--r-- | tests/test_nodes.py | 60 |
1 files changed, 0 insertions, 60 deletions
diff --git a/tests/test_nodes.py b/tests/test_nodes.py index 1d8d67a0..aabd2611 100644 --- a/tests/test_nodes.py +++ b/tests/test_nodes.py @@ -338,66 +338,6 @@ class IfNodeTest(_NodeTest): self.assertEqual(self.astroid.body[1].orelse[0].block_range(7), (7, 8)) self.assertEqual(self.astroid.body[1].orelse[0].block_range(8), (8, 8)) - @staticmethod - @pytest.mark.filterwarnings("ignore:.*is_sys_guard:DeprecationWarning") - def test_if_sys_guard() -> None: - code = builder.extract_node( - """ - import sys - if sys.version_info > (3, 8): #@ - pass - - if sys.version_info[:2] > (3, 8): #@ - pass - - if sys.some_other_function > (3, 8): #@ - pass - """ - ) - assert isinstance(code, list) and len(code) == 3 - - assert isinstance(code[0], nodes.If) - assert code[0].is_sys_guard() is True - assert isinstance(code[1], nodes.If) - assert code[1].is_sys_guard() is True - - assert isinstance(code[2], nodes.If) - assert code[2].is_sys_guard() is False - - @staticmethod - @pytest.mark.filterwarnings("ignore:.*is_typing_guard:DeprecationWarning") - def test_if_typing_guard() -> None: - code = builder.extract_node( - """ - import typing - import typing as t - from typing import TYPE_CHECKING - - if typing.TYPE_CHECKING: #@ - pass - - if t.TYPE_CHECKING: #@ - pass - - if TYPE_CHECKING: #@ - pass - - if typing.SOME_OTHER_CONST: #@ - pass - """ - ) - assert isinstance(code, list) and len(code) == 4 - - assert isinstance(code[0], nodes.If) - assert code[0].is_typing_guard() is True - assert isinstance(code[1], nodes.If) - assert code[1].is_typing_guard() is True - assert isinstance(code[2], nodes.If) - assert code[2].is_typing_guard() is True - - assert isinstance(code[3], nodes.If) - assert code[3].is_typing_guard() is False - class TryExceptNodeTest(_NodeTest): CODE = """ |