Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

BF: protect against locale in sphinext text #6601

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 1 commit into from
Jul 2, 2016
Merged
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
BF: protect against locale in sphinext text
The sphinxext tests were loading a text file with encoding not stated,
making the test sensitive to the default locale of the testing machine.

See:
https://travis-ci.org/matthew-brett/matplotlib-wheels/jobs/138518917#L8787

Read the text file as binary to avoid need for encoding.
  • Loading branch information
matthew-brett committed Jun 18, 2016
commit 2b4d2dcee8467219af5a492fc97a858f0552356e
6 changes: 3 additions & 3 deletions 6 lib/matplotlib/sphinxext/tests/test_tinypages.py
Original file line number Diff line number Diff line change
Expand Up @@ -80,11 +80,11 @@ def plot_file(num):
# Plot 13 shows close-figs in action
assert_true(file_same(range_4, plot_file(13)))
# Plot 14 has included source
with open(pjoin(self.html_dir, 'some_plots.html'), 'rt') as fobj:
with open(pjoin(self.html_dir, 'some_plots.html'), 'rb') as fobj:
html_contents = fobj.read()
assert_true('# Only a comment' in html_contents)
assert_true(b'# Only a comment' in html_contents)
# check plot defined in external file.
assert_true(file_same(range_4, pjoin(self.html_dir, 'range4.png')))
assert_true(file_same(range_6, pjoin(self.html_dir, 'range6.png')))
# check if figure caption made it into html file
assert_true('This is the caption for plot 15.' in html_contents)
assert_true(b'This is the caption for plot 15.' in html_contents)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.