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

Fix randomly failing tests #2437

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
Sep 19, 2013
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
Clear the font caches on every test. This should prevent problems whe…
…re setting font properties will leak over into another test.
  • Loading branch information
mdboom committed Sep 18, 2013
commit 9eda53b2fc1bd3eba48e7e37f9829794ab416b12
11 changes: 10 additions & 1 deletion 11 lib/matplotlib/tests/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@

import difflib

from matplotlib import rcParams, rcdefaults, use


_multiprocess_can_split_ = True

Expand All @@ -12,6 +14,7 @@ def setup():
# it during all of the tests.
import locale
import warnings
from matplotlib.backends import backend_agg, backend_pdf, backend_svg

try:
locale.setlocale(locale.LC_ALL, str('en_US.UTF-8'))
Expand All @@ -28,11 +31,17 @@ def setup():
# These settings *must* be hardcoded for running the comparison
# tests and are not necessarily the default values as specified in
# rcsetup.py
rcdefaults() # Start with all defaults
rcdefaults() # Start with all defaults
rcParams['font.family'] = 'Bitstream Vera Sans'
rcParams['text.hinting'] = False
rcParams['text.hinting_factor'] = 8

# Clear the font caches. Otherwise, the hinting mode can travel
# from one test to another.
backend_agg.RendererAgg._fontd.clear()
backend_pdf.RendererPdf.truetype_font_cache.clear()
backend_svg.RendererSVG.fontd.clear()


def assert_str_equal(reference_str, test_str,
format_str='String {str1} and {str2} do not match:\n{differences}'):
Expand Down
Morty Proxy This is a proxified and sanitized view of the page, visit original site.