3d6eaf353b92d1ae2bfd0575f2061230aab1b94f,hyperspy/tests/drawing/test_utils.py,,test_create_figure,#,31
Before Change
assert isinstance(fig, matplotlib.figure.Figure) == True
matplotlib.pyplot.close(fig)
if original_backend == "agg": // switch back to the original backend
matplotlib.pyplot.switch_backend(original_backend)
After Change
@cleanup
def test_create_figure():
dummy_warning = "dummy_function have been called after closing windows"
if matplotlib.get_backend() not in ("GTKAgg", "WXAgg", "TkAgg", "Qt4Agg"):
pytest.xfail("{} backend does not support on_close event.".format(
matplotlib.get_backend()))
dummy_function = Mock()
fig = utils.create_figure(window_title="test title",
_on_figure_window_close=dummy_function)
assert isinstance(fig, matplotlib.figure.Figure) == True
In pattern: SUPERPATTERN
Frequency: 3
Non-data size: 4
Instances
Project Name: hyperspy/hyperspy
Commit Name: 3d6eaf353b92d1ae2bfd0575f2061230aab1b94f
Time: 2017-02-27
Author: frandelapena@gmail.com
File Name: hyperspy/tests/drawing/test_utils.py
Class Name:
Method Name: test_create_figure
Project Name: scipy/scipy
Commit Name: d9ceecf937d697c51ff83c743c1c60158c100cb0
Time: 2019-11-05
Author: larson.eric.d@gmail.com
File Name: scipy/conftest.py
Class Name:
Method Name: pytest_runtest_setup
Project Name: ilastik/ilastik
Commit Name: 26f4a69895c2e66303cacfeb369f0b9ac99290c2
Time: 2018-11-19
Author: mnovikov.work@gmail.com
File Name: tests/helpers/shellGuiTestCaseBase.py
Class Name: ShellGuiTestCaseBase
Method Name: setup_class