File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -454,10 +454,10 @@ def test_if_rctemplate_is_up_to_date():
454454 .format (missing .items ()))
455455
456456
457- def test_if_rctemplate_would_be_valid ():
457+ def test_if_rctemplate_would_be_valid (tmpdir ):
458458 # This tests if the matplotlibrc.template file would result in a valid
459459 # rc file if all lines are uncommented.
460- path_to_rc = mpl .matplotlib_fname ()
460+ path_to_rc = "matplotlibrc.txt" # mpl.matplotlib_fname() #
461461 with open (path_to_rc , "r" ) as f :
462462 rclines = f .readlines ()
463463 newlines = []
@@ -471,17 +471,15 @@ def test_if_rctemplate_would_be_valid():
471471 if "datapath" in newline :
472472 newline = ""
473473 newlines .append (newline )
474- #print(os.path.dirname(__file__))
475- fname = os .path .join (os .path .dirname (__file__ ),
476- 'testrcvalid.temp' )
474+ d = tmpdir .mkdir ('test1' )
475+ fname = str (d .join ('testrcvalid.temp' ))
477476 with open (fname , "w" ) as f :
478477 f .writelines (newlines )
479478 with pytest .warns (None ) as record :
480479 dic = mpl .rc_params_from_file (fname ,
481480 fail_on_error = True ,
482481 use_default_template = False )
483482 assert len (record ) == 0
484- os .remove (fname )
485483 #d1 = set(dic.keys())
486484 #d2 = set(matplotlib.defaultParams.keys())
487485 #print(d2-d1)
You can’t perform that action at this time.
0 commit comments