Skip to content
This repository was archived by the owner on Feb 13, 2025. It is now read-only.

Commit f95329c

Browse files
author
Anselm Kruis
committed
merge 3.5-slp (Stackless #112, fix pickle/copy tests)
2 parents 7f9f400 + bf6be12 commit f95329c

File tree

3 files changed

+7
-0
lines changed

3 files changed

+7
-0
lines changed

Lib/test/test_dictviews.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
import copy
33
import pickle
44
import unittest
5+
import test.support
56

67
class 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):

Lib/test/test_generators.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff 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

Lib/test/test_xml_etree.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff 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()

0 commit comments

Comments
 (0)