8000 Add tests for toolmanager. · matplotlib/matplotlib@1134670 · GitHub
[go: up one dir, main page]

Skip to content

Commit 1134670

Browse files
committed
Add tests for toolmanager.
... and fix Help tool for tk (it needs a gif icon, generated (like the other gifs) with `convert -antialias -geometry 24x24 help.svg help.gif`). ... and also edit the matplotlibrc template to mention its availability.
1 parent d9b722f commit 1134670

File tree

4 files changed

+7
-4
lines changed

4 files changed

+7
-4
lines changed

lib/matplotlib/backend_tools.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1030,7 +1030,7 @@ def _mouse_move(self, event):
10301030
class ToolHelpBase(ToolBase):
10311031
description = 'Print tool list, shortcuts and description'
10321032
default_keymap = mpl.rcParams['keymap.help']
1033-
image = 'help.png'
1033+
image = 'help'
10341034

10351035
@staticmethod
10361036
def format_shortcut(key_sequence):

lib/matplotlib/tests/test_backends_interactive.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,8 @@ def _get_testable_interactive_backends():
6767
"webagg.open_in_browser": False,
6868
"webagg.port_retries": 1,
6969
})
70+
if len(sys.argv) == 2:
71+
rcParams["toolbar"] = sys.argv[1]
7072
backend = plt.rcParams["backend"].lower()
7173
assert_equal = TestCase().assertEqual
7274
assert_raises = TestCase().assertRaises
@@ -119,10 +121,11 @@ def check_alt_backend(alt_backend):
119121

120122

121123
@pytest.mark.parametrize("backend", _get_testable_interactive_backends())
124+
@pytest.mark.parametrize("toolbar", ["toolbar2", "toolmanager"])
122125
@pytest.mark.flaky(reruns=3)
123-
def test_interactive_backend(backend):
126+
def test_interactive_backend(backend, toolbar):
124127
proc = subprocess.run(
125-
[sys.executable, "-c", _test_script],
128+
[sys.executable, "-c", _test_script, toolbar],
126129
env={**os.environ, "MPLBACKEND": backend}, timeout=_test_timeout,
127130
stdout=subprocess.PIPE, universal_newlines=True)
128131
if proc.returncode:

matplotlibrc.template

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@
9292
#backend_fallback: True
9393

9494
#interactive: False
95-
#toolbar: toolbar2 # {None, toolbar2}
95+
#toolbar: toolbar2 # {None, toolbar2, toolmanager}
9696
#timezone: UTC # a pytz timezone string, e.g., US/Central or Europe/Paris
9797

9898

0 commit comments

Comments
 (0)
0