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

Skip to content

Commit 2430747

Browse files
committed
Update/tidy test_rcparams.py and move mpl.rc to test_rcparams.rc.
1 parent a54325e commit 2430747

File tree

4 files changed

+11
-5
lines changed

4 files changed

+11
-5
lines changed

lib/matplotlib/__init__.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1050,6 +1050,7 @@ def tk_window_focus():
10501050
'matplotlib.tests.test_dates',
10511051
'matplotlib.tests.test_spines',
10521052
'matplotlib.tests.test_image',
1053+
'matplotlib.tests.test_rcparams',
10531054
'matplotlib.tests.test_simplification',
10541055
'matplotlib.tests.test_mathtext',
10551056
'matplotlib.tests.test_text',

lib/matplotlib/tests/mpl.rc

Lines changed: 0 additions & 1 deletion
This file was deleted.

lib/matplotlib/tests/test_rcparams.py

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@
44
mpl.rc('text', usetex=False)
55
mpl.rc('lines', linewidth=22)
66

7-
fname = os.path.abspath(os.path.dirname(__file__)) + os.sep + 'mpl.rc'
8-
7+
fname = os.path.join(os.path.dirname(__file__), 'test_rcparams.rc')
8+
99
def test_rcparams():
1010

1111
usetex = mpl.rcParams['text.usetex']
@@ -27,8 +27,11 @@ def test_rcparams():
2727
assert mpl.rcParams['lines.linewidth'] == linewidth
2828

2929
# test rc_file
30-
mpl.rc_file(fname)
31-
assert mpl.rcParams['lines.linewidth'] == 33
30+
try:
31+
mpl.rc_file(fname)
32+
assert mpl.rcParams['lines.linewidth'] == 33
33+
finally:
34+
mpl.rcParams['lines.linewidth'] = linewidth
3235

3336

3437
if __name__ == '__main__':

lib/matplotlib/tests/test_rcparams.rc

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# this file is used by the tests in test_rcparams.py
2+
3+
lines.linewidth: 33

0 commit comments

Comments
 (0)