summaryrefslogtreecommitdiffstats
path: root/Lib/test
diff options
context:
space:
mode:
authorBrett Cannon <brett@python.org>2011-03-15 22:45:59 (GMT)
committerBrett Cannon <brett@python.org>2011-03-15 22:45:59 (GMT)
commitf47e3ac7b79db4f95ed812b5f819317144f35c7f (patch)
tree2ff5d0f1e3d48a7dca097a28116c5227ab558f1f /Lib/test
parentb8daeda5232100e28628326eec702d9fa37314ad (diff)
parent72d46933368f0ee192d50e421b1648af5c0adf51 (diff)
downloadcpython-f47e3ac7b79db4f95ed812b5f819317144f35c7f.zip
cpython-f47e3ac7b79db4f95ed812b5f819317144f35c7f.tar.gz
cpython-f47e3ac7b79db4f95ed812b5f819317144f35c7f.tar.bz2
merge
Diffstat (limited to 'Lib/test')
-rw-r--r--Lib/test/test_peepholer.py15
1 files changed, 14 insertions, 1 deletions
diff --git a/Lib/test/test_peepholer.py b/Lib/test/test_peepholer.py
index a9eb23f..f73565e 100644
--- a/Lib/test/test_peepholer.py
+++ b/Lib/test/test_peepholer.py
@@ -19,6 +19,7 @@ def disassemble(func):
def dis_single(line):
return disassemble(compile(line, '', 'single'))
+
class TestTranforms(unittest.TestCase):
def test_unot(self):
@@ -294,11 +295,23 @@ class TestTranforms(unittest.TestCase):
self.assertNotIn('BINARY_', asm, e)
self.assertNotIn('BUILD_', asm, e)
+class TestBuglets(unittest.TestCase):
+
+ def test_bug_11510(self):
+ # folded constant set optimization was commingled with the tuple
+ # unpacking optimization which would fail if the set had duplicate
+ # elements so that the set length was unexpected
+ def f():
+ x, y = {1, 1}
+ return x, y
+ with self.assertRaises(ValueError):
+ f()
+
def test_main(verbose=None):
import sys
from test import support
- test_classes = (TestTranforms,)
+ test_classes = (TestTranforms, TestBuglets)
support.run_unittest(*test_classes)
# verify reference counting