Author: Raffael Tfirst <[email protected]>
Branch: py3.5-async
Changeset: r86043:0f39cfd33706
Date: 2016-08-05 21:42 +0200
http://bitbucket.org/pypy/pypy/changeset/0f39cfd33706/
Log: Add tests for BUILD_MAP_UNPACK
diff --git a/pypy/interpreter/test/test_interpreter.py
b/pypy/interpreter/test/test_interpreter.py
--- a/pypy/interpreter/test/test_interpreter.py
+++ b/pypy/interpreter/test/test_interpreter.py
@@ -256,7 +256,18 @@
return a, b, c, d
"""
assert self.codetest(code, "f", [1, 2], {"d" : 4, "c" : 3}) == (1, 2,
3, 4)
-
+
+ def test_build_map_unpack(self):
+ code = """
+ def f():
+ return {'x': 1, **{'y': 2}}
+ def g():
+ return {**()}
+ """
+ assert self.codetest(code, "f", []) == {'x': 1, 'y': 2}
+ res = self.codetest(code, 'g', [])
+ assert "TypeError:" in res
+ assert "'tuple' object is not a mapping" in res
class AppTestInterpreter:
_______________________________________________
pypy-commit mailing list
[email protected]
https://mail.python.org/mailman/listinfo/pypy-commit