@@ -430,12 +430,11 @@ def test_if_rctemplate_is_up_to_date():
430
430
dep1 = mpl ._all_deprecated
431
431
dep2 = mpl ._deprecated_set
432
432
deprecated = list (dep1 .union (dep2 ))
433
- #print(deprecated)
434
- path_to_rc = mpl .matplotlib_fname ()
433
+ path_to_rc = os .path .join (mpl .get_data_path (), 'matplotlibrc' )
435
434
with open (path_to_rc , "r" ) as f :
436
435
rclines = f .readlines ()
437
436
missing = {}
438
- for k ,v in mpl .defaultParams .items ():
437
+ for k , v in mpl .defaultParams .items ():
439
438
if k [0 ] == "_" :
440
439
continue
441
440
if k in deprecated :
@@ -447,7 +446,7 @@ def test_if_rctemplate_is_up_to_date():
447
446
if k in line :
448
447
found = True
449
448
if not found :
450
- missing .update ({k :v })
449
+ missing .update ({k : v })
451
450
if missing :
452
451
raise ValueError ("The following params are missing " +
453
452
"in the matplotlibrc.template file: {}"
@@ -457,7 +456,7 @@ def test_if_rctemplate_is_up_to_date():
457
456
def test_if_rctemplate_would_be_valid (tmpdir ):
458
457
# This tests if the matplotlibrc.template file would result in a valid
459
458
# rc file if all lines are uncommented.
460
- path_to_rc = mpl .matplotlib_fname ( )
459
+ path_to_rc = os . path . join ( mpl .get_data_path (), 'matplotlibrc' )
461
460
with open (path_to_rc , "r" ) as f :
462
461
rclines = f .readlines ()
463
462
newlines = []
@@ -476,10 +475,7 @@ def test_if_rctemplate_would_be_valid(tmpdir):
476
475
with open (fname , "w" ) as f :
477
476
f .writelines (newlines )
478
477
with pytest .warns (None ) as record :
479
- dic = mpl .rc_params_from_file (fname ,
480
- fail_on_error = True ,
481
- use_default_template = False )
478
+ mpl .rc_params_from_file (fname ,
479
+ fail_on_error = True ,
480
+ use_default_template = False )
482
481
assert len (record ) == 0
483
- #d1 = set(dic.keys())
484
- #d2 = set(matplotlib.defaultParams.keys())
485
- #print(d2-d1)
0 commit comments