diff options
Diffstat (limited to 'pypy/objspace/std/test/test_setobject.py')
-rw-r--r-- | pypy/objspace/std/test/test_setobject.py | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/pypy/objspace/std/test/test_setobject.py b/pypy/objspace/std/test/test_setobject.py index a68ffe24f5..e4e3c74a1c 100644 --- a/pypy/objspace/std/test/test_setobject.py +++ b/pypy/objspace/std/test/test_setobject.py @@ -1085,4 +1085,12 @@ class AppTestAppSetTest: assert "frozenset" in str(e.value) if hasattr(frozenset.copy, 'im_func'): e = raises(TypeError, frozenset.copy.im_func, 42) - assert "'set-or-frozenset'" in str(e.value) + assert "'frozenset' object expected, got 'int' instead" in str(e.value) + if hasattr(set.copy, 'im_func'): + e = raises(TypeError, set.copy.im_func, 42) + assert "'set' object expected, got 'int' instead" in str(e.value) + + def test_cant_mutate_frozenset_via_set(self): + x = frozenset() + raises(TypeError, set.add.im_func, x, 1) + raises(TypeError, set.__ior__.im_func, x, set([2])) |