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
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
TST: Fixed rcparams test_Issue_1713 test
  • Loading branch information
Kojoley committed Oct 24, 2016
commit 70285e103170dba4bda1cb80d3b7b9c9dded921f
14 changes: 7 additions & 7 deletions 14 lib/matplotlib/tests/test_rcparams.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,10 @@

from cycler import cycler, Cycler

try:
from unittest import mock
except ImportError:
import mock
import matplotlib as mpl
import matplotlib.pyplot as plt
from matplotlib.tests import assert_str_equal
Expand Down Expand Up @@ -227,13 +231,9 @@ def test_legend_edgecolor():
def test_Issue_1713():
utf32_be = os.path.join(os.path.dirname(__file__),
'test_utf32_be_rcparams.rc')
old_lang = os.environ.get('LANG', None)
os.environ['LANG'] = 'en_US.UTF-32-BE'
rc = mpl.rc_params_from_file(utf32_be, True)
if old_lang:
os.environ['LANG'] = old_lang
else:
del os.environ['LANG']
import locale
with mock.patch('locale.getpreferredencoding', return_value='UTF-32-BE'):
rc = mpl.rc_params_from_file(utf32_be, True, False)
assert rc.get('timezone') == 'UTC'


Expand Down
Morty Proxy This is a proxified and sanitized view of the page, visit original site.