Permalink
Browse files

Update/tidy test_rcparams.py and move mpl.rc to test_rcparams.rc.

  • Loading branch information...
memmett committed Aug 12, 2012
1 parent a54325e commit 2430747e8b5a512a7f648761579ccfb14ca65d2b
@@ -1050,6 +1050,7 @@ def tk_window_focus():
'matplotlib.tests.test_dates',
'matplotlib.tests.test_spines',
'matplotlib.tests.test_image',
+ 'matplotlib.tests.test_rcparams',
'matplotlib.tests.test_simplification',
'matplotlib.tests.test_mathtext',
'matplotlib.tests.test_text',
@@ -1 +0,0 @@
-lines.linewidth: 33
@@ -4,8 +4,8 @@
mpl.rc('text', usetex=False)
mpl.rc('lines', linewidth=22)
-fname = os.path.abspath(os.path.dirname(__file__)) + os.sep + 'mpl.rc'
-
+fname = os.path.join(os.path.dirname(__file__), 'test_rcparams.rc')
+
def test_rcparams():
usetex = mpl.rcParams['text.usetex']
@@ -27,8 +27,11 @@ def test_rcparams():
assert mpl.rcParams['lines.linewidth'] == linewidth
# test rc_file
- mpl.rc_file(fname)
- assert mpl.rcParams['lines.linewidth'] == 33
+ try:
+ mpl.rc_file(fname)
+ assert mpl.rcParams['lines.linewidth'] == 33
+ finally:
+ mpl.rcParams['lines.linewidth'] = linewidth
if __name__ == '__main__':
@@ -0,0 +1,3 @@
+# this file is used by the tests in test_rcparams.py
+
+lines.linewidth: 33

0 comments on commit 2430747

Please sign in to comment.