Skip to content
Browse files

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

  • Loading branch information...
1 parent 45cba0f commit c8f5512fdc3b6eb76b40be8c242b5afd0e1f2bf2 @memmett committed
View
1 lib/matplotlib/__init__.py
@@ -1068,6 +1068,7 @@ def tk_window_focus():
'matplotlib.tests.test_mathtext',
'matplotlib.tests.test_mlab',
'matplotlib.tests.test_patches',
+ 'matplotlib.tests.test_rcparams',
'matplotlib.tests.test_simplification',
'matplotlib.tests.test_spines',
'matplotlib.tests.test_text',
View
1 lib/matplotlib/tests/mpl.rc
@@ -1 +0,0 @@
-lines.linewidth: 33
View
11 lib/matplotlib/tests/test_rcparams.py
@@ -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__':
View
3 lib/matplotlib/tests/test_rcparams.rc
@@ -0,0 +1,3 @@
+# this file is used by the tests in test_rcparams.py
+
+lines.linewidth: 33

0 comments on commit c8f5512

Please sign in to comment.
Something went wrong with that request. Please try again.