Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 229dbfc

Browse filesBrowse 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 229dbfc
Copy full SHA for 229dbfc

File tree

Expand file treeCollapse file tree

4 files changed

+10
-4
lines changed
Filter options
Expand file treeCollapse file tree

4 files changed

+10
-4
lines changed

‎lib/matplotlib/backend_tools.py

Copy file name to clipboardExpand all lines: lib/matplotlib/backend_tools.py
+1-1Lines 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):
564 Bytes
Loading

‎lib/matplotlib/tests/test_backends_interactive.py

Copy file name to clipboardExpand all lines: lib/matplotlib/tests/test_backends_interactive.py
+8-2Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import importlib
22
import importlib.util
3+
import json
34
import os
45
import signal
56
import subprocess
@@ -57,6 +58,7 @@ def _get_testable_interactive_backends():
5758
_test_script = """\
5859
import importlib
5960
import importlib.util
61+
import json
6062
import sys
6163
from unittest import TestCase
6264
@@ -67,6 +69,8 @@ def _get_testable_interactive_backends():
6769
"webagg.open_in_browser": False,
6870
"webagg.port_retries": 1,
6971
})
72+
if len(sys.argv) >= 2: # Second argument is json-encoded rcParams.
73+
rcParams.update(json.loads(sys.argv[1]))
7074
backend = plt.rcParams["backend"].lower()
7175
assert_equal = TestCase().assertEqual
7276
assert_raises = TestCase().assertRaises
@@ -119,10 +123,12 @@ def check_alt_backend(alt_backend):
119123

120124

121125
@pytest.mark.parametrize("backend", _get_testable_interactive_backends())
126+
@pytest.mark.parametrize("toolbar", ["toolbar2", "toolmanager"])
122127
@pytest.mark.flaky(reruns=3)
123-
def test_interactive_backend(backend):
128+
def test_interactive_backend(backend, toolbar):
124129
proc = subprocess.run(
125-
[sys.executable, "-c", _test_script],
130+
[sys.executable, "-c", _test_script,
131+
json.dumps({"toolbar": toolbar})],
126132
env={**os.environ, "MPLBACKEND": backend}, timeout=_test_timeout,
127133
stdout=subprocess.PIPE, universal_newlines=True)
128134
if proc.returncode:

‎matplotlibrc.template

Copy file name to clipboardExpand all lines: matplotlibrc.template
+1-1Lines 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)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.