Skip to content

Commit

Permalink
Skip type parameter tests in python <3.12
Browse files Browse the repository at this point in the history
  • Loading branch information
dflook committed Nov 7, 2023
1 parent cfbbe5a commit cfa29fb
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 0 deletions.
4 changes: 4 additions & 0 deletions test/renaming/test_bind_names.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,8 @@ def expected(namespace_type, node_type, name='', global_names=None, nonlocal_nam
return ns

def test_functiondef_binding():
if sys.version_info < (3, 12):
pytest.skip('Type Parameters not supported in Python < 3.12')

source = '''
@decorator
Expand All @@ -82,6 +84,8 @@ def A[B](C):
assert_namespace_tree(module_namespace, expected_namespaces)

def test_classdef_binding():
if sys.version_info < (3, 12):
pytest.skip('Type Parameters not supported in Python < 3.12')

source = '''
@decorator
Expand Down
6 changes: 6 additions & 0 deletions test/renaming/test_create_namespaces.py
Original file line number Diff line number Diff line change
Expand Up @@ -166,6 +166,8 @@ def test_dictcomp():
assert_namespace_tree(module_namespace, expected_namespaces)

def test_typeparam():
if sys.version_info < (3, 12):
pytest.skip('Type Parameters not supported in Python < 3.12')

source = '''
@decorator
Expand Down Expand Up @@ -225,6 +227,8 @@ def test_lambda():
assert_namespace_tree(module_namespace, expected_namespaces)

def test_async_functiondef():
if sys.version_info < (3, 12):
pytest.skip('Type Parameters not supported in Python < 3.12')

source = '''
@decorator
Expand Down Expand Up @@ -253,6 +257,8 @@ async def f[T: int, U: (int, str), *V, **P](
assert_namespace_tree(module_namespace, expected_namespaces)

def test_classdef():
if sys.version_info < (3, 12):
pytest.skip('Type Parameters not supported in Python < 3.12')

source = '''
@decorator
Expand Down
4 changes: 4 additions & 0 deletions test/renaming/test_resolve_names.py
Original file line number Diff line number Diff line change
Expand Up @@ -466,6 +466,8 @@ def C():
assert print_namespace(module_namespace) == print_namespace(expected_namespaces)

def test_function_type_params():
if sys.version_info < (3, 12):
pytest.skip('Type Parameters not supported in Python < 3.12')

source = '''
def A[T]():
Expand Down Expand Up @@ -495,6 +497,8 @@ def A[T]():
assert print_namespace(module_namespace) == print_namespace(expected_namespaces)

def test_function_class_type_params():
if sys.version_info < (3, 12):
pytest.skip('Type Parameters not supported in Python < 3.12')

source = '''
class Class[T]:
Expand Down

0 comments on commit cfa29fb

Please sign in to comment.