summaryrefslogtreecommitdiff
path: root/Lib/test
diff options
context:
space:
mode:
Diffstat (limited to 'Lib/test')
-rw-r--r--Lib/test/test_peepholer.py14
1 files changed, 13 insertions, 1 deletions
diff --git a/Lib/test/test_peepholer.py b/Lib/test/test_peepholer.py
index a9eb23fde3..a40b4b7a01 100644
--- a/Lib/test/test_peepholer.py
+++ b/Lib/test/test_peepholer.py
@@ -294,11 +294,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