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

Skip to content

TST: splitlines in rec2txt test #6423

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
May 17, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,7 @@ test_script:
- '%CMD_IN_ENV% python setup.py develop'
# tests
- python tests.py
# remove to get around libpng issue?
- python visual_tests.py

after_test:
Expand All @@ -108,7 +109,7 @@ after_test:
- cmd: path
- cmd: where python
- cmd: '%CMD_IN_ENV% conda config --get channels'
- cmd: '%CMD_IN_ENV% conda build .\ci\conda_recipe'
# - cmd: '%CMD_IN_ENV% conda build .\ci\conda_recipe'

# Move the conda package into the dist directory, to register it
# as an "artifact" for Appveyor.
Expand Down
5 changes: 2 additions & 3 deletions lib/matplotlib/mlab.py
Original file line number Diff line number Diff line change
Expand Up @@ -3188,9 +3188,8 @@ def get_justify(colname, column, precision):
ntype = column.dtype

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

if np.issubdtype(ntype, np.int):
Expand Down
8 changes: 4 additions & 4 deletions lib/matplotlib/tests/test_mlab.py
Original file line number Diff line number Diff line change
Expand Up @@ -403,10 +403,10 @@ def test_csv2txt_basic(self):
(str('y'), np.int8),
(str('s'), str, 3),
(str('s2'), str, 4)]))
truth = (' x y s s2\n'
' 1.000 2 foo bing \n'
' 2.000 3 bar blah ')
assert_equal(mlab.rec2txt(a), truth)
truth = (' x y s s2\n'
' 1.000 2 foo bing \n'
' 2.000 3 bar blah ').splitlines()
assert_equal(mlab.rec2txt(a).splitlines(), truth)


class window_testcase(CleanupTestCase):
Expand Down