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

Commit bf6be12

Browse files
author
Anselm Kruis
committed
Issue #112: Prepare Stackless 3.5, fix test_dictviews, test_generators and test_xml_etree
Disable the recently added test methods test_copy() and test_pickle() in test_dictviews, test_generators and test_xml_etree. Theses test assure that objects can't be copied or pickled, but Stackless can copy/pickle them. https://bitbucket.org/stackless-dev/stackless/issues/112
1 parent 643681c commit bf6be12

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
@@ -1,6 +1,7 @@
11
import copy
22
import pickle
33
import unittest
4+
import test.support
45

56
class DictSetTest(unittest.TestCase):
67

@@ -199,12 +200,14 @@ def test_recursive_repr(self):
199200
d[42] = d.values()
200201
self.assertRaises(RecursionError, repr, d)
201202

203+
@unittest.skipIf(test.support.stackless, "Stackless can copy dictviews")
202204
def test_copy(self):
203205
d = {1: 10, "a": "ABC"}
204206
self.assertRaises(TypeError, copy.copy, d.keys())
205207
self.assertRaises(TypeError, copy.copy, d.values())
206208
self.assertRaises(TypeError, copy.copy, d.items())
207209

210+
@unittest.skipIf(test.support.stackless, "Stackless can pickle dictviews")
208211
def test_pickle(self):
209212
d = {1: 10, "a": "ABC"}
210213
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
@@ -2083,12 +2083,14 @@ def test_iter_by_tag(self):
20832083
self.assertEqual(self._ilist(doc), all_tags)
20842084
self.assertEqual(self._ilist(doc, '*'), all_tags)
20852085

2086+
@unittest.skipIf(support.stackless, "Stackless can copy iterators")
20862087
def test_copy(self):
20872088
a = ET.Element('a')
20882089
it = a.iter()
20892090
with self.assertRaises(TypeError):
20902091
copy.copy(it)
20912092

2093+
@unittest.skipIf(support.stackless, "Stackless can pickle iterators")
20922094
def test_pickle(self):
20932095
a = ET.Element('a')
20942096
it = a.iter()

0 commit comments

Comments
 (0)