diff options
Diffstat (limited to 'Lib/test')
-rw-r--r-- | Lib/test/test_descr.py | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/Lib/test/test_descr.py b/Lib/test/test_descr.py index 208201cf78..1c0b366cc3 100644 --- a/Lib/test/test_descr.py +++ b/Lib/test/test_descr.py @@ -4206,6 +4206,19 @@ def notimplemented(): check(iexpr, c, N1) check(iexpr, c, N2) +def test_assign_slice(): + # ceval.c's assign_slice used to check for + # tp->tp_as_sequence->sq_slice instead of + # tp->tp_as_sequence->sq_ass_slice + + class C(object): + def __setslice__(self, start, stop, value): + self.value = value + + c = C() + c[1:2] = 3 + vereq(c.value, 3) + def test_main(): weakref_segfault() # Must be first, somehow wrapper_segfault() @@ -4301,6 +4314,7 @@ def test_main(): test_init() methodwrapper() notimplemented() + test_assign_slice() from test import test_descr run_doctest(test_descr, verbosity=True) |