Author: Armin Rigo <[email protected]>
Branch: py3.5
Changeset: r88926:54f2cae1a873
Date: 2016-12-07 10:16 +0100
http://bitbucket.org/pypy/pypy/changeset/54f2cae1a873/
Log: Fix the pickling tests for functools.partial
diff --git a/lib-python/3/test/test_functools.py
b/lib-python/3/test/test_functools.py
--- a/lib-python/3/test/test_functools.py
+++ b/lib-python/3/test/test_functools.py
@@ -16,7 +16,12 @@
import functools
py_functools = support.import_fresh_module('functools', blocked=['_functools'])
-c_functools = support.import_fresh_module('functools', fresh=['_functools'])
+c_functools = functools
+# pypy: was:
+# c_functools = support.import_fresh_module('functools',
fresh=['_functools'])
+# but this creates confusion for pickle because on pypy, _functools is a
+# pure python module, whereas on CPython it is C (and so not really
+# re-importable)
decimal = support.import_fresh_module('decimal', fresh=['_decimal'])
diff --git a/pypy/module/test_lib_pypy/test_functools.py
b/pypy/module/test_lib_pypy/test_functools.py
--- a/pypy/module/test_lib_pypy/test_functools.py
+++ b/pypy/module/test_lib_pypy/test_functools.py
@@ -17,6 +17,8 @@
assert partial.func == test_partial_setstate
def test_partial_pickle():
+ pytest.skip("can't run this test: _functools.partial now has "
+ "__module__=='functools', in this case confusing pickle")
import pickle
partial1 = _functools.partial(test_partial_pickle)
string = pickle.dumps(partial1)
_______________________________________________
pypy-commit mailing list
[email protected]
https://mail.python.org/mailman/listinfo/pypy-commit