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

Add tests for toolmanager. #16933

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Apr 15, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion 2 lib/matplotlib/backend_tools.py
Original file line number Diff line number Diff line change
Expand Up @@ -992,7 +992,7 @@ def _mouse_move(self, event):
class ToolHelpBase(ToolBase):
description = 'Print tool list, shortcuts and description'
default_keymap = mpl.rcParams['keymap.help']
image = 'help.png'
image = 'help'

@staticmethod
def format_shortcut(key_sequence):
Expand Down
Binary file added BIN +564 Bytes lib/matplotlib/mpl-data/images/help.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
12 changes: 10 additions & 2 deletions 12 lib/matplotlib/tests/test_backends_interactive.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import importlib
import importlib.util
import json
import os
import signal
import subprocess
Expand Down Expand Up @@ -60,6 +61,7 @@ def _get_testable_interactive_backends():
_test_script = """\
import importlib
import importlib.util
import json
import sys
from unittest import TestCase

Expand All @@ -70,6 +72,8 @@ def _get_testable_interactive_backends():
"webagg.open_in_browser": False,
"webagg.port_retries": 1,
})
if len(sys.argv) >= 2: # Second argument is json-encoded rcParams.
rcParams.update(json.loads(sys.argv[1]))
backend = plt.rcParams["backend"].lower()
assert_equal = TestCase().assertEqual
assert_raises = TestCase().assertRaises
Expand Down Expand Up @@ -122,10 +126,14 @@ def check_alt_backend(alt_backend):


@pytest.mark.parametrize("backend", _get_testable_interactive_backends())
@pytest.mark.parametrize("toolbar", ["toolbar2", "toolmanager"])
@pytest.mark.flaky(reruns=3)
def test_interactive_backend(backend):
def test_interactive_backend(backend, toolbar):
if backend == "macosx" and toolbar == "toolmanager":
pytest.skip("toolmanager is not implemented for macosx.")
proc = subprocess.run(
[sys.executable, "-c", _test_script],
[sys.executable, "-c", _test_script,
json.dumps({"toolbar": toolbar})],
env={**os.environ, "MPLBACKEND": backend}, timeout=_test_timeout,
stdout=subprocess.PIPE, universal_newlines=True)
if proc.returncode:
Expand Down
2 changes: 1 addition & 1 deletion 2 matplotlibrc.template
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@
#backend_fallback: True

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


Expand Down
Morty Proxy This is a proxified and sanitized view of the page, visit original site.