Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 049ae4d

Browse files
jseaboldcertik
authored andcommitted
TST: Change expected output for Python 3.
1 parent b3b367f commit 049ae4d

1 file changed

Lines changed: 8 additions & 1 deletion

File tree

numpy/core/tests/test_arrayprint.py

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
#!/usr/bin/python
2+
# -*- coding: utf-8 -*-
13
import sys
24
import numpy as np
35
from numpy.testing import *
@@ -148,8 +150,13 @@ def test_formatter_reset(self):
148150
assert_equal(repr(x), "array([ 0., 1., 2.])")
149151

150152
def test_unicode_object_array():
153+
import sys
154+
if sys.version_info[0] >= 3:
155+
expected = "array(['é'], dtype=object)"
156+
else:
157+
expected = "array([u'\\xe9'], dtype=object)"
151158
x = np.array([u'\xe9'], dtype=object)
152-
assert_equal(repr(x), "array([u'\\xe9'], dtype=object)")
159+
assert_equal(repr(x), expected)
153160

154161

155162

0 commit comments

Comments
 (0)