Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
P
Pyston
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
Boxiang Sun
Pyston
Commits
95017841
Commit
95017841
authored
Sep 15, 2015
by
Kevin Modzelewski
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add CPython's test_pickle.py
parent
5a04076c
Changes
5
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
1419 additions
and
1 deletion
+1419
-1
CMakeLists.txt
CMakeLists.txt
+1
-1
from_cpython/Lib/test/pickletester.py
from_cpython/Lib/test/pickletester.py
+1323
-0
from_cpython/Lib/test/test_pickle.py
from_cpython/Lib/test/test_pickle.py
+93
-0
test/CPYTHON_TEST_NOTES.md
test/CPYTHON_TEST_NOTES.md
+1
-0
test/cpython/test_pickle.py
test/cpython/test_pickle.py
+1
-0
No files found.
CMakeLists.txt
View file @
95017841
...
...
@@ -336,4 +336,4 @@ else()
endif
()
# last file added (need to change this if we add a file that is added via a glob):
# from_cpython/Lib/test/
test_re
.py
# from_cpython/Lib/test/
pickletester
.py
from_cpython/Lib/test/pickletester.py
0 → 100644
View file @
95017841
This diff is collapsed.
Click to expand it.
from_cpython/Lib/test/test_pickle.py
0 → 100644
View file @
95017841
# expected: fail
import
pickle
from
cStringIO
import
StringIO
from
test
import
test_support
from
test.pickletester
import
(
AbstractPickleTests
,
AbstractPickleModuleTests
,
AbstractPersistentPicklerTests
,
AbstractPicklerUnpicklerObjectTests
,
BigmemPickleTests
)
class
PickleTests
(
AbstractPickleTests
,
AbstractPickleModuleTests
):
def
dumps
(
self
,
arg
,
proto
=
0
,
fast
=
0
):
# Ignore fast
return
pickle
.
dumps
(
arg
,
proto
)
def
loads
(
self
,
buf
):
# Ignore fast
return
pickle
.
loads
(
buf
)
module
=
pickle
error
=
KeyError
class
PicklerTests
(
AbstractPickleTests
):
error
=
KeyError
def
dumps
(
self
,
arg
,
proto
=
0
,
fast
=
0
):
f
=
StringIO
()
p
=
pickle
.
Pickler
(
f
,
proto
)
if
fast
:
p
.
fast
=
fast
p
.
dump
(
arg
)
f
.
seek
(
0
)
return
f
.
read
()
def
loads
(
self
,
buf
):
f
=
StringIO
(
buf
)
u
=
pickle
.
Unpickler
(
f
)
return
u
.
load
()
class
PersPicklerTests
(
AbstractPersistentPicklerTests
):
def
dumps
(
self
,
arg
,
proto
=
0
,
fast
=
0
):
class
PersPickler
(
pickle
.
Pickler
):
def
persistent_id
(
subself
,
obj
):
return
self
.
persistent_id
(
obj
)
f
=
StringIO
()
p
=
PersPickler
(
f
,
proto
)
if
fast
:
p
.
fast
=
fast
p
.
dump
(
arg
)
f
.
seek
(
0
)
return
f
.
read
()
def
loads
(
self
,
buf
):
class
PersUnpickler
(
pickle
.
Unpickler
):
def
persistent_load
(
subself
,
obj
):
return
self
.
persistent_load
(
obj
)
f
=
StringIO
(
buf
)
u
=
PersUnpickler
(
f
)
return
u
.
load
()
class
PicklerUnpicklerObjectTests
(
AbstractPicklerUnpicklerObjectTests
):
pickler_class
=
pickle
.
Pickler
unpickler_class
=
pickle
.
Unpickler
class
PickleBigmemPickleTests
(
BigmemPickleTests
):
def
dumps
(
self
,
arg
,
proto
=
0
,
fast
=
0
):
# Ignore fast
return
pickle
.
dumps
(
arg
,
proto
)
def
loads
(
self
,
buf
):
# Ignore fast
return
pickle
.
loads
(
buf
)
def
test_main
():
test_support
.
run_unittest
(
PickleTests
,
PicklerTests
,
PersPicklerTests
,
PicklerUnpicklerObjectTests
,
PickleBigmemPickleTests
,
)
test_support
.
run_doctest
(
pickle
)
if
__name__
==
"__main__"
:
test_main
()
test/CPYTHON_TEST_NOTES.md
View file @
95017841
...
...
@@ -57,6 +57,7 @@ test_mutants unknown failure
test_optparse assertion instead of exceptions for long("invalid number")
test_pep277 segfaults
test_pep352 various unique bugs
test_pickle unknown
test_pkg unknown bug
test_random long("invalid number")
test_repr complex.__hash__; some unknown issues
...
...
test/cpython/test_pickle.py
0 → 120000
View file @
95017841
..
/
..
/
from_cpython
/
Lib
/
test
/
test_pickle
.
py
\ No newline at end of file
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