This repository was archived by the owner on Feb 13, 2025. It is now read-only.
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 2
2
import copy
3
3
import pickle
4
4
import unittest
5
+ import test .support
5
6
6
7
class DictSetTest (unittest .TestCase ):
7
8
@@ -200,12 +201,14 @@ def test_recursive_repr(self):
200
201
d [42 ] = d .values ()
201
202
self .assertRaises (RecursionError , repr , d )
202
203
204
+ @unittest .skipIf (test .support .stackless , "Stackless can copy dictviews" )
203
205
def test_copy (self ):
204
206
d = {1 : 10 , "a" : "ABC" }
205
207
self .assertRaises (TypeError , copy .copy , d .keys ())
206
208
self .assertRaises (TypeError , copy .copy , d .values ())
207
209
self .assertRaises (TypeError , copy .copy , d .items ())
208
210
211
+ @unittest .skipIf (test .support .stackless , "Stackless can pickle dictviews" )
209
212
def test_pickle (self ):
210
213
d = {1 : 10 , "a" : "ABC" }
211
214
for proto in range (pickle .HIGHEST_PROTOCOL + 1 ):
Original file line number Diff line number Diff line change @@ -113,13 +113,15 @@ def func():
113
113
self .assertEqual (gen .__qualname__ ,
114
114
"GeneratorTest.test_name.<locals>.<genexpr>" )
115
115
116
+ @unittest .skipIf (support .stackless , "Stackless can copy generators" )
116
117
def test_copy (self ):
117
118
def f ():
118
119
yield 1
119
120
g = f ()
120
121
with self .assertRaises (TypeError ):
121
122
copy .copy (g )
122
123
124
+ @unittest .skipIf (support .stackless , "Stackless can pickle generators" )
123
125
def test_pickle (self ):
124
126
def f ():
125
127
yield 1
Original file line number Diff line number Diff line change @@ -2137,12 +2137,14 @@ def test_iter_by_tag(self):
2137
2137
self .assertEqual (self ._ilist (doc ), all_tags )
2138
2138
self .assertEqual (self ._ilist (doc , '*' ), all_tags )
2139
2139
2140
+ @unittest .skipIf (support .stackless , "Stackless can copy iterators" )
2140
2141
def test_copy (self ):
2141
2142
a = ET .Element ('a' )
2142
2143
it = a .iter ()
2143
2144
with self .assertRaises (TypeError ):
2144
2145
copy .copy (it )
2145
2146
2147
+ @unittest .skipIf (support .stackless , "Stackless can pickle iterators" )
2146
2148
def test_pickle (self ):
2147
2149
a = ET .Element ('a' )
2148
2150
it = a .iter ()
You can’t perform that action at this time.
0 commit comments