38
38
# SOFTWARE.
39
39
import copy
40
40
import random
41
+ import sys
41
42
import unittest
42
43
from collections import deque
43
44
@@ -209,6 +210,7 @@ def test_extend(self):
209
210
d .extend (d )
210
211
self .assertEqual (list (d ), list ('abcdabcd' ))
211
212
213
+ @unittest .skipIf (sys .implementation .name == 'cpython' and sys .version_info [0 :2 ] < (3 , 5 ), "skipping for cPython versions < 3.5" )
212
214
def test_add (self ):
213
215
d = deque ()
214
216
e = deque ('abc' )
@@ -265,6 +267,7 @@ def test_getitem(self):
265
267
self .assertRaises (IndexError , d .__getitem__ , 0 )
266
268
self .assertRaises (IndexError , d .__getitem__ , - 1 )
267
269
270
+ @unittest .skipIf (sys .implementation .name == 'cpython' and sys .version_info [0 :2 ] < (3 , 5 ), "skipping for cPython versions < 3.5" )
268
271
def test_index (self ):
269
272
for n in 1 , 2 , 30 , 40 , 200 :
270
273
@@ -301,11 +304,13 @@ def test_index(self):
301
304
else :
302
305
self .assertEqual (d .index (element , start , stop ), target )
303
306
307
+ @unittest .skipIf (sys .implementation .name == 'cpython' and sys .version_info [0 :2 ] < (3 , 5 ), "skipping for cPython versions < 3.5" )
304
308
def test_index_bug_24913 (self ):
305
309
d = deque ('A' * 3 )
306
310
with self .assertRaises (ValueError ):
307
311
i = d .index ("Hello world" , 0 , 4 )
308
312
313
+ @unittest .skipIf (sys .implementation .name == 'cpython' and sys .version_info [0 :2 ] < (3 , 5 ), "skipping for cPython versions < 3.5" )
309
314
def test_imul (self ):
310
315
for n in (- 10 , - 1 , 0 , 1 , 2 , 10 , 1000 ):
311
316
d = deque ()
@@ -337,6 +342,7 @@ def test_imul(self):
337
342
self .assertEqual (d , deque (('abcdef' * n )[- 500 :]))
338
343
self .assertEqual (d .maxlen , 500 )
339
344
345
+ @unittest .skipIf (sys .implementation .name == 'cpython' and sys .version_info [0 :2 ] < (3 , 5 ), "skipping for cPython versions < 3.5" )
340
346
def test_mul (self ):
341
347
d = deque ('abc' )
342
348
self .assertEqual (d * - 5 , deque ())
@@ -586,6 +592,7 @@ def test_roundtrip_iter_init(self):
586
592
self .assertNotEqual (id (d ), id (e ))
587
593
self .assertEqual (list (d ), list (e ))
588
594
595
+ @unittest .skipIf (sys .implementation .name == 'cpython' and sys .version_info [0 :2 ] < (3 , 5 ), "skipping for cPython versions < 3.5" )
589
596
def test_copy (self ):
590
597
mut = [10 ]
591
598
d = deque ([mut ])
@@ -604,6 +611,7 @@ def test_copy(self):
604
611
self .assertEqual (d .maxlen , e .maxlen )
605
612
self .assertTrue (all (x is y for x , y in zip (d , e )))
606
613
614
+ @unittest .skipIf (sys .implementation .name == 'cpython' and sys .version_info [0 :2 ] < (3 , 5 ), "skipping for cPython versions < 3.5" )
607
615
def test_copy_method (self ):
608
616
mut = [10 ]
609
617
d = deque ([mut ])
0 commit comments