Skip to content

Commit 9afdcb8

Browse files
Remove repetitive pytest skips
1 parent be3e26e commit 9afdcb8

File tree

1 file changed

+11
-5
lines changed

1 file changed

+11
-5
lines changed

tests/test_type_params.py

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,19 @@
66

77
from astroid import extract_node
88
from astroid.const import PY312_PLUS
9-
from astroid.nodes import AssignName, ParamSpec, Subscript, TypeAlias, TypeVar, TypeVarTuple
9+
from astroid.nodes import (
10+
AssignName,
11+
ParamSpec,
12+
Subscript,
13+
TypeAlias,
14+
TypeVar,
15+
TypeVarTuple,
16+
)
17+
18+
if not PY312_PLUS:
19+
pytest.skip("Requires Python 3.12 or higher", allow_module_level=True)
1020

1121

12-
@pytest.mark.skipif(not PY312_PLUS, reason="Requires Python 3.12 or higher")
1322
def test_type_alias() -> None:
1423
node = extract_node("type Point[T] = list[float, float]")
1524
assert isinstance(node, TypeAlias)
@@ -27,7 +36,6 @@ def test_type_alias() -> None:
2736
assert node.type_params[0].inferred()[0] is node.type_params[0]
2837

2938

30-
@pytest.mark.skipif(not PY312_PLUS, reason="Requires Python 3.12 or higher")
3139
def test_type_param_spec() -> None:
3240
node = extract_node("type Alias[**P] = Callable[P, int]")
3341
params = node.type_params[0]
@@ -38,7 +46,6 @@ def test_type_param_spec() -> None:
3846
assert node.inferred()[0] is node
3947

4048

41-
@pytest.mark.skipif(not PY312_PLUS, reason="Requires Python 3.12 or higher")
4249
def test_type_var_tuple() -> None:
4350
node = extract_node("type Alias[*Ts] = tuple[*Ts]")
4451
params = node.type_params[0]
@@ -49,7 +56,6 @@ def test_type_var_tuple() -> None:
4956
assert node.inferred()[0] is node
5057

5158

52-
@pytest.mark.skipif(not PY312_PLUS, reason="Requires Python 3.12 or higher")
5359
def test_type_param() -> None:
5460
func_node = extract_node("def func[T]() -> T: ...")
5561
assert isinstance(func_node.type_params[0], TypeVar)

0 commit comments

Comments
 (0)