Skip to content

Commit 326cc05

Browse files
committed
Merge pull request #6423 from tacaswell/tst_fix_windows_print_test
TST: splitlines in rec2txt test
2 parents 273da36 + 7765024 commit 326cc05

File tree

3 files changed

+8
-8
lines changed

3 files changed

+8
-8
lines changed

appveyor.yml

+2-1
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,7 @@ test_script:
8989
- '%CMD_IN_ENV% python setup.py develop'
9090
# tests
9191
- python tests.py
92+
# remove to get around libpng issue?
9293
- python visual_tests.py
9394

9495
after_test:
@@ -108,7 +109,7 @@ after_test:
108109
- cmd: path
109110
- cmd: where python
110111
- cmd: '%CMD_IN_ENV% conda config --get channels'
111-
- cmd: '%CMD_IN_ENV% conda build .\ci\conda_recipe'
112+
# - cmd: '%CMD_IN_ENV% conda build .\ci\conda_recipe'
112113

113114
# Move the conda package into the dist directory, to register it
114115
# as an "artifact" for Appveyor.

lib/matplotlib/mlab.py

+2-3
Original file line numberDiff line numberDiff line change
@@ -3188,9 +3188,8 @@ def get_justify(colname, column, precision):
31883188
ntype = column.dtype
31893189

31903190
if np.issubdtype(ntype, str) or np.issubdtype(ntype, bytes):
3191-
# The division below handles unicode stored in array, which could
3192-
# have 4 bytes per char
3193-
length = max(len(colname), column.itemsize // column[0].itemsize)
3191+
fixed_width = int(ntype.str[2:])
3192+
length = max(len(colname), fixed_width)
31943193
return 0, length+padding, "%s" # left justify
31953194

31963195
if np.issubdtype(ntype, np.int):

lib/matplotlib/tests/test_mlab.py

+4-4
Original file line numberDiff line numberDiff line change
@@ -403,10 +403,10 @@ def test_csv2txt_basic(self):
403403
(str('y'), np.int8),
404404
(str('s'), str, 3),
405405
(str('s2'), str, 4)]))
406-
truth = (' x y s s2\n'
407-
' 1.000 2 foo bing \n'
408-
' 2.000 3 bar blah ')
409-
assert_equal(mlab.rec2txt(a), truth)
406+
truth = (' x y s s2\n'
407+
' 1.000 2 foo bing \n'
408+
' 2.000 3 bar blah ').splitlines()
409+
assert_equal(mlab.rec2txt(a).splitlines(), truth)
410410

411411

412412
class window_testcase(CleanupTestCase):

0 commit comments

Comments
 (0)