Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cpython
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
cpython
Commits
c6b54b45
Commit
c6b54b45
authored
Sep 29, 2015
by
Serhiy Storchaka
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Moved unpickling tests with prepickled data to separate class.
parent
37f81355
Changes
2
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
233 additions
and
212 deletions
+233
-212
Lib/test/pickletester.py
Lib/test/pickletester.py
+215
-209
Lib/test/test_pickle.py
Lib/test/test_pickle.py
+18
-3
No files found.
Lib/test/pickletester.py
View file @
c6b54b45
This diff is collapsed.
Click to expand it.
Lib/test/test_pickle.py
View file @
c6b54b45
...
...
@@ -10,6 +10,7 @@ import sys
import
unittest
from
test
import
support
from
test.pickletester
import
AbstractUnpickleTests
from
test.pickletester
import
AbstractPickleTests
from
test.pickletester
import
AbstractPickleModuleTests
from
test.pickletester
import
AbstractPersistentPicklerTests
...
...
@@ -28,6 +29,16 @@ class PickleTests(AbstractPickleModuleTests):
pass
class
PyUnpicklerTests
(
AbstractUnpickleTests
):
unpickler
=
pickle
.
_Unpickler
def
loads
(
self
,
buf
,
**
kwds
):
f
=
io
.
BytesIO
(
buf
)
u
=
self
.
unpickler
(
f
,
**
kwds
)
return
u
.
load
()
class
PyPicklerTests
(
AbstractPickleTests
):
pickler
=
pickle
.
_Pickler
...
...
@@ -46,7 +57,8 @@ class PyPicklerTests(AbstractPickleTests):
return
u
.
load
()
class
InMemoryPickleTests
(
AbstractPickleTests
,
BigmemPickleTests
):
class
InMemoryPickleTests
(
AbstractPickleTests
,
AbstractUnpickleTests
,
BigmemPickleTests
):
pickler
=
pickle
.
_Pickler
unpickler
=
pickle
.
_Unpickler
...
...
@@ -105,6 +117,9 @@ class PyChainDispatchTableTests(AbstractDispatchTableTests):
if
has_c_implementation
:
class
CUnpicklerTests
(
PyUnpicklerTests
):
unpickler
=
_pickle
.
Unpickler
class
CPicklerTests
(
PyPicklerTests
):
pickler
=
_pickle
.
Pickler
unpickler
=
_pickle
.
Unpickler
...
...
@@ -372,11 +387,11 @@ class CompatPickleTests(unittest.TestCase):
def
test_main
():
tests
=
[
PickleTests
,
PyPicklerTests
,
PyPersPicklerTests
,
tests
=
[
PickleTests
,
Py
UnpicklerTests
,
Py
PicklerTests
,
PyPersPicklerTests
,
PyDispatchTableTests
,
PyChainDispatchTableTests
,
CompatPickleTests
]
if
has_c_implementation
:
tests
.
extend
([
CPicklerTests
,
CPersPicklerTests
,
tests
.
extend
([
C
UnpicklerTests
,
C
PicklerTests
,
CPersPicklerTests
,
CDumpPickle_LoadPickle
,
DumpPickle_CLoadPickle
,
PyPicklerUnpicklerObjectTests
,
CPicklerUnpicklerObjectTests
,
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment