| .. | |||||
| __pycache__ | |||||
| __init__.py | |||||
| harness.py | |||||
| test_api.py | |||||
| test_builtin.py | |||||
| test_checker.py | |||||
| test_code_segment.py | |||||
| test_dict.py | |||||
| test_doctests.py | |||||
| test_imports.py | |||||
| test_is_literal.py | |||||
| test_match.py | |||||
| test_other.py | |||||
| test_type_annotations.py | |||||
| test_undefined_names.py |
"""
Tests for detecting redefinition of builtins.
"""
from pyflakes import messages as m
from pyflakes.test.harness import TestCase
class TestBuiltins(TestCase):
def test_builtin_unbound_local(self):
self.flakes('''
def foo():
a = range(1, 10)
range = a
return range
foo()
print(range)
''', m.UndefinedLocal)
def test_global_shadowing_builtin(self):
self.flakes('''
def f():
global range
range = None
print(range)
f()
''')
| .. | |||||
| __pycache__ | |||||
| __init__.py | |||||
| harness.py | |||||
| test_api.py | |||||
| test_builtin.py | |||||
| test_checker.py | |||||
| test_code_segment.py | |||||
| test_dict.py | |||||
| test_doctests.py | |||||
| test_imports.py | |||||
| test_is_literal.py | |||||
| test_match.py | |||||
| test_other.py | |||||
| test_type_annotations.py | |||||
| test_undefined_names.py |