mirror of
https://github.com/python/cpython.git
synced 2025-08-04 00:48:58 +00:00
test for specific bug in vars()
This commit is contained in:
parent
1d59df28ac
commit
a49d94af08
1 changed files with 9 additions and 0 deletions
|
@ -238,6 +238,15 @@ b = dir(sys)
|
|||
a.sort()
|
||||
b.sort()
|
||||
if a <> b: raise TestFailed, 'vars(sys)'
|
||||
def f0():
|
||||
if vars() != {}: raise TestFailed, 'vars() in f0()'
|
||||
f0()
|
||||
def f2():
|
||||
f0()
|
||||
a = 1
|
||||
b = 2
|
||||
if vars() != {'a': a, 'b': b}: raise TestFailed, 'vars() in f2()'
|
||||
f2()
|
||||
|
||||
print 'xrange'
|
||||
if tuple(xrange(10)) <> tuple(range(10)): raise TestFailed, 'xrange(10)'
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue