Thanks to visit codestin.com Credit goes to github.com
We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent e6eecba commit ac5f694Copy full SHA for ac5f694
lib/matplotlib/tests/test_pyplot.py
@@ -440,3 +440,18 @@ def test_switch_backend_no_close():
440
assert len(plt.get_fignums()) == 2
441
plt.switch_backend('svg')
442
assert len(plt.get_fignums()) == 0
443
+
444
445
+def figure_hook_example(figure):
446
+ figure._test_was_here = True
447
448
449
+def test_figure_hook():
450
451
+ test_rc = {
452
+ 'figure.hooks': ['matplotlib.tests.test_pyplot:figure_hook_example']
453
+ }
454
+ with mpl.rc_context(test_rc):
455
+ fig = plt.figure()
456
457
+ assert fig._test_was_here
0 commit comments