diff options
Diffstat (limited to 'tests')
-rw-r--r-- | tests/brain/test_brain.py | 28 | ||||
-rw-r--r-- | tests/brain/test_exceptions.py | 0 | ||||
-rw-r--r-- | tests/brain/test_pytest.py | 34 |
3 files changed, 34 insertions, 28 deletions
diff --git a/tests/brain/test_brain.py b/tests/brain/test_brain.py index 700d5b4e..316e742f 100644 --- a/tests/brain/test_brain.py +++ b/tests/brain/test_brain.py @@ -143,34 +143,6 @@ class ThreadingBrainTest(unittest.TestCase): self.assertIsInstance(next(inferred.igetattr(method)), astroid.BoundMethod) -class PytestBrainTest(unittest.TestCase): - def test_pytest(self) -> None: - ast_node = builder.extract_node( - """ - import pytest - pytest #@ - """ - ) - module = next(ast_node.infer()) - attrs = [ - "deprecated_call", - "warns", - "exit", - "fail", - "skip", - "importorskip", - "xfail", - "mark", - "raises", - "freeze_includes", - "set_trace", - "fixture", - "yield_fixture", - ] - for attr in attrs: - self.assertIn(attr, module) - - def streams_are_fine(): """Check if streams are being overwritten, for example, by pytest diff --git a/tests/brain/test_exceptions.py b/tests/brain/test_exceptions.py new file mode 100644 index 00000000..e69de29b --- /dev/null +++ b/tests/brain/test_exceptions.py diff --git a/tests/brain/test_pytest.py b/tests/brain/test_pytest.py new file mode 100644 index 00000000..55ecfb2d --- /dev/null +++ b/tests/brain/test_pytest.py @@ -0,0 +1,34 @@ +# Licensed under the LGPL: https://www.gnu.org/licenses/old-licenses/lgpl-2.1.en.html +# For details: https://github.com/PyCQA/astroid/blob/main/LICENSE +# Copyright (c) https://github.com/PyCQA/astroid/blob/main/CONTRIBUTORS.txt + +from __future__ import annotations + +from astroid import builder + + +def test_pytest() -> None: + ast_node = builder.extract_node( + """ + import pytest + pytest #@ + """ + ) + module = next(ast_node.infer()) + attrs = [ + "deprecated_call", + "warns", + "exit", + "fail", + "skip", + "importorskip", + "xfail", + "mark", + "raises", + "freeze_includes", + "set_trace", + "fixture", + "yield_fixture", + ] + for attr in attrs: + assert attr in module |