File tree Expand file tree Collapse file tree 2 files changed +6
-5
lines changed
Expand file tree Collapse file tree 2 files changed +6
-5
lines changed Original file line number Diff line number Diff line change 1212 " from matplotlib import pyplot \n " ,
1313 " from open_atmos_jupyter_utils import show_plot\n " ,
1414 " \n " ,
15- " pyplot.plot([] )\n " ,
16- " show_plot()"
15+ " fig = pyplot.figure( )\n " ,
16+ " show_plot(fig )"
1717 ],
1818 "id" : " 840cd46405eb9d0e" ,
1919 "outputs" : [
Original file line number Diff line number Diff line change 66import pytest
77import matplotlib
88
9+
910from open_atmos_jupyter_utils import notebook_vars
10- import examples
1111
1212@pytest .fixture (scope = "session" , name = "notebook_variables" )
1313def notebook_variables_fixture ():
1414 """returns variables from the notebook """
1515 return notebook_vars (
16- file = Path (examples . __file__ ).parent / "notebook_vars.ipynb" ,
16+ file = str ( Path (__file__ ).parent . parent / "examples" / " notebook_vars.ipynb") ,
1717 plot = False ,
1818 )
1919class TestNotebookVars :
@@ -24,6 +24,7 @@ def test_notebook_vars(notebook_variables):
2424 assert notebook_variables ["c" ] == notebook_variables ["a" ] + notebook_variables ["b" ]
2525
2626 @staticmethod
27- def test_plots_closed ():
27+ def test_plots_closed (notebook_variables ):
2828 """ checks all figures closed """
29+ assert isinstance (notebook_variables ["fig" ], matplotlib .figure .Figure )
2930 assert 0 == len (matplotlib .pyplot .get_fignums ())
You can’t perform that action at this time.
0 commit comments