summaryrefslogtreecommitdiff
path: root/numpy
diff options
context:
space:
mode:
authorCharles Harris <charlesr.harris@gmail.com>2012-05-10 01:26:38 -0600
committerCharles Harris <charlesr.harris@gmail.com>2012-05-10 01:33:18 -0600
commitddc944eb6ae67de5c0e184505651ca1f50517bbd (patch)
treea339c52a8f7b4b0bd9c2725b090231c18f9be24b /numpy
parentdc468d1e2cebf350a38e719741f691db2c2f1bdc (diff)
downloadnumpy-ddc944eb6ae67de5c0e184505651ca1f50517bbd.tar.gz
BUG: Fix datetime 1.6 pickle compatibility test for Python 3.
In Python 3 the pickle.loads function expects a bytes argument, so convert the test strings.
Diffstat (limited to 'numpy')
-rw-r--r--numpy/core/tests/test_datetime.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/numpy/core/tests/test_datetime.py b/numpy/core/tests/test_datetime.py
index aaafce012..cb62182cd 100644
--- a/numpy/core/tests/test_datetime.py
+++ b/numpy/core/tests/test_datetime.py
@@ -537,15 +537,15 @@ class TestDateTime(TestCase):
pkl = "cnumpy\ndtype\np0\n(S'M8'\np1\nI0\nI1\ntp2\nRp3\n" + \
"(I4\nS'<'\np4\nNNNI-1\nI-1\nI0\n((dp5\n(S'D'\np6\n" + \
"I7\nI1\nI1\ntp7\ntp8\ntp9\nb."
- assert_equal(pickle.loads(pkl), np.dtype('<M8[7D]'))
+ assert_equal(pickle.loads(asbytes(pkl)), np.dtype('<M8[7D]'))
pkl = "cnumpy\ndtype\np0\n(S'M8'\np1\nI0\nI1\ntp2\nRp3\n" + \
"(I4\nS'<'\np4\nNNNI-1\nI-1\nI0\n((dp5\n(S'W'\np6\n" + \
"I1\nI1\nI1\ntp7\ntp8\ntp9\nb."
- assert_equal(pickle.loads(pkl), np.dtype('<M8[W]'))
+ assert_equal(pickle.loads(asbytes(pkl)), np.dtype('<M8[W]'))
pkl = "cnumpy\ndtype\np0\n(S'M8'\np1\nI0\nI1\ntp2\nRp3\n" + \
"(I4\nS'>'\np4\nNNNI-1\nI-1\nI0\n((dp5\n(S'us'\np6\n" + \
"I1\nI1\nI1\ntp7\ntp8\ntp9\nb."
- assert_equal(pickle.loads(pkl), np.dtype('>M8[us]'))
+ assert_equal(pickle.loads(asbytes(pkl)), np.dtype('>M8[us]'))
def test_dtype_promotion(self):
# datetime <op> datetime computes the metadata gcd