File tree Expand file tree Collapse file tree 3 files changed +7
-0
lines changed
Expand file tree Collapse file tree 3 files changed +7
-0
lines changed Original file line number Diff line number Diff line change 22import copy
33import pickle
44import unittest
5+ import test .support
56
67class DictSetTest (unittest .TestCase ):
78
@@ -200,12 +201,14 @@ def test_recursive_repr(self):
200201 d [42 ] = d .values ()
201202 self .assertRaises (RecursionError , repr , d )
202203
204+ @unittest .skipIf (test .support .stackless , "Stackless can copy dictviews" )
203205 def test_copy (self ):
204206 d = {1 : 10 , "a" : "ABC" }
205207 self .assertRaises (TypeError , copy .copy , d .keys ())
206208 self .assertRaises (TypeError , copy .copy , d .values ())
207209 self .assertRaises (TypeError , copy .copy , d .items ())
208210
211+ @unittest .skipIf (test .support .stackless , "Stackless can pickle dictviews" )
209212 def test_pickle (self ):
210213 d = {1 : 10 , "a" : "ABC" }
211214 for proto in range (pickle .HIGHEST_PROTOCOL + 1 ):
Original file line number Diff line number Diff line change @@ -113,13 +113,15 @@ def func():
113113 self .assertEqual (gen .__qualname__ ,
114114 "GeneratorTest.test_name.<locals>.<genexpr>" )
115115
116+ @unittest .skipIf (support .stackless , "Stackless can copy generators" )
116117 def test_copy (self ):
117118 def f ():
118119 yield 1
119120 g = f ()
120121 with self .assertRaises (TypeError ):
121122 copy .copy (g )
122123
124+ @unittest .skipIf (support .stackless , "Stackless can pickle generators" )
123125 def test_pickle (self ):
124126 def f ():
125127 yield 1
Original file line number Diff line number Diff line change @@ -2137,12 +2137,14 @@ def test_iter_by_tag(self):
21372137 self .assertEqual (self ._ilist (doc ), all_tags )
21382138 self .assertEqual (self ._ilist (doc , '*' ), all_tags )
21392139
2140+ @unittest .skipIf (support .stackless , "Stackless can copy iterators" )
21402141 def test_copy (self ):
21412142 a = ET .Element ('a' )
21422143 it = a .iter ()
21432144 with self .assertRaises (TypeError ):
21442145 copy .copy (it )
21452146
2147+ @unittest .skipIf (support .stackless , "Stackless can pickle iterators" )
21462148 def test_pickle (self ):
21472149 a = ET .Element ('a' )
21482150 it = a .iter ()
You can’t perform that action at this time.
0 commit comments