Skip to content

Commit

Permalink
Name constant binding is different in python3.3
Browse files Browse the repository at this point in the history
  • Loading branch information
dflook committed Aug 18, 2024
1 parent 705829d commit c471c9e
Showing 1 changed file with 18 additions and 2 deletions.
20 changes: 18 additions & 2 deletions test/test_bind_names.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,8 @@ def namespace_name(node):
return s

def test_module_namespace():
if sys.version_info < (3, 0):
pytest.skip('Test requires python 3.0 or later')
if sys.version_info >= (3, 4):
pytest.skip('Test requires python 3.4 or later')

source = '''
name_in_module = True
Expand All @@ -68,6 +68,22 @@ def test_module_namespace():

assert_namespace_tree(source, expected_namespaces)

def test_module_namespace_python33():
if sys.version_info < (3, 4) and sys.version_info >= (3, 0):
pytest.skip('Test requires python 3.3')

source = '''
name_in_module = True
name_in_module = True
'''

expected_namespaces = '''
+ Module
- NameBinding(name='name_in_module', allow_rename=True) <references=2>
- BuiltinBinding(name='True', allow_rename=True) <references=2>
'''

assert_namespace_tree(source, expected_namespaces)

def test_lambda_namespace():
if sys.version_info < (3, 0):
Expand Down

0 comments on commit c471c9e

Please sign in to comment.