]> crepu.dev Git - config.git/blame - djavu-asus/elpy/rpc-venv/lib/python3.11/site-packages/pyflakes/test/test_builtin.py
ActualizaciĆ³n de Readme
[config.git] / djavu-asus / elpy / rpc-venv / lib / python3.11 / site-packages / pyflakes / test / test_builtin.py
CommitLineData
53e6db90
DC
1"""
2Tests for detecting redefinition of builtins.
3"""
4from pyflakes import messages as m
5from pyflakes.test.harness import TestCase
6
7
8class TestBuiltins(TestCase):
9
10 def test_builtin_unbound_local(self):
11 self.flakes('''
12 def foo():
13 a = range(1, 10)
14 range = a
15 return range
16
17 foo()
18
19 print(range)
20 ''', m.UndefinedLocal)
21
22 def test_global_shadowing_builtin(self):
23 self.flakes('''
24 def f():
25 global range
26 range = None
27 print(range)
28
29 f()
30 ''')