Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 2e7e2f7

Browse filesBrowse files
author
Anselm Kruis
committed
Issue python#100: fix the test case test.test_pickler.SizeofTests.test_pickler
Adapt the test case to Stackless. Its C struct PicklerObject has an additional member. https://bitbucket.org/stackless-dev/stackless/issues/100
1 parent dad1337 commit 2e7e2f7
Copy full SHA for 2e7e2f7

File tree

Expand file treeCollapse file tree

1 file changed

+8
-1
lines changed
Filter options
Expand file treeCollapse file tree

1 file changed

+8
-1
lines changed

‎Lib/test/test_pickle.py

Copy file name to clipboardExpand all lines: Lib/test/test_pickle.py
+8-1Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,12 @@
2020
except ImportError:
2121
has_c_implementation = False
2222

23+
try:
24+
import stackless
25+
has_stackless = True
26+
except ImportError:
27+
has_stackless = False
28+
2329

2430
class PickleTests(AbstractPickleModuleTests):
2531
pass
@@ -146,7 +152,8 @@ class SizeofTests(unittest.TestCase):
146152
check_sizeof = support.check_sizeof
147153

148154
def test_pickler(self):
149-
basesize = support.calcobjsize('5P2n3i2n3iP')
155+
basesize = support.calcobjsize('5P2n3i2n3iP' +
156+
('P' if has_stackless else ''))
150157
p = _pickle.Pickler(io.BytesIO())
151158
self.assertEqual(object.__sizeof__(p), basesize)
152159
MT_size = struct.calcsize('3nP0n')

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.