summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGuido van Rossum <guido@python.org>1995-08-11 14:24:35 (GMT)
committerGuido van Rossum <guido@python.org>1995-08-11 14:24:35 (GMT)
commita49d94af0841cf0602c6c2083c578e339d31a790 (patch)
tree6815d0dbd1b3a1fb76d00716ff916cd7d88df85f
parent1d59df28ac32e6bcd449255b092b6acd7d31672a (diff)
downloadcpython-a49d94af0841cf0602c6c2083c578e339d31a790.zip
cpython-a49d94af0841cf0602c6c2083c578e339d31a790.tar.gz
cpython-a49d94af0841cf0602c6c2083c578e339d31a790.tar.bz2
test for specific bug in vars()
-rw-r--r--Lib/test/test_b2.py9
1 files changed, 9 insertions, 0 deletions
diff --git a/Lib/test/test_b2.py b/Lib/test/test_b2.py
index 9963779..62d17b9 100644
--- a/Lib/test/test_b2.py
+++ b/Lib/test/test_b2.py
@@ -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)'