Skip to content

Commit e809036

Browse files
[brain tests] Burst pytest from the main file
1 parent 55afe5d commit e809036

File tree

3 files changed

+34
-28
lines changed

3 files changed

+34
-28
lines changed

tests/brain/test_brain.py

Lines changed: 0 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -143,34 +143,6 @@ def assert_is_valid_lock(self, inferred: Instance) -> None:
143143
self.assertIsInstance(next(inferred.igetattr(method)), astroid.BoundMethod)
144144

145145

146-
class PytestBrainTest(unittest.TestCase):
147-
def test_pytest(self) -> None:
148-
ast_node = builder.extract_node(
149-
"""
150-
import pytest
151-
pytest #@
152-
"""
153-
)
154-
module = next(ast_node.infer())
155-
attrs = [
156-
"deprecated_call",
157-
"warns",
158-
"exit",
159-
"fail",
160-
"skip",
161-
"importorskip",
162-
"xfail",
163-
"mark",
164-
"raises",
165-
"freeze_includes",
166-
"set_trace",
167-
"fixture",
168-
"yield_fixture",
169-
]
170-
for attr in attrs:
171-
self.assertIn(attr, module)
172-
173-
174146
def streams_are_fine():
175147
"""Check if streams are being overwritten,
176148
for example, by pytest

tests/brain/test_exceptions.py

Whitespace-only changes.

tests/brain/test_pytest.py

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
# Licensed under the LGPL: https://www.gnu.org/licenses/old-licenses/lgpl-2.1.en.html
2+
# For details: https://github.com/PyCQA/astroid/blob/main/LICENSE
3+
# Copyright (c) https://github.com/PyCQA/astroid/blob/main/CONTRIBUTORS.txt
4+
5+
from __future__ import annotations
6+
7+
from astroid import builder
8+
9+
10+
def test_pytest() -> None:
11+
ast_node = builder.extract_node(
12+
"""
13+
import pytest
14+
pytest #@
15+
"""
16+
)
17+
module = next(ast_node.infer())
18+
attrs = [
19+
"deprecated_call",
20+
"warns",
21+
"exit",
22+
"fail",
23+
"skip",
24+
"importorskip",
25+
"xfail",
26+
"mark",
27+
"raises",
28+
"freeze_includes",
29+
"set_trace",
30+
"fixture",
31+
"yield_fixture",
32+
]
33+
for attr in attrs:
34+
assert attr in module

0 commit comments

Comments
 (0)