Skip to content

Commit

Permalink
Make pywin32 optional in Ctrl+C Qt test.
Browse files Browse the repository at this point in the history
  • Loading branch information
QuLogic committed Aug 23, 2021
1 parent 9e8c8fa commit 852a63b
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/matplotlib/tests/test_backend_qt.py
Expand Up @@ -39,8 +39,8 @@ def platform_simulate_ctrl_c(request):
from functools import partial

if hasattr(signal, "CTRL_C_EVENT"):
from win32api import GenerateConsoleCtrlEvent
return partial(GenerateConsoleCtrlEvent, 0, 0)
win32api = pytest.importorskip('win32api')
return partial(win32api.GenerateConsoleCtrlEvent, 0, 0)
else:
# we're not on windows
return partial(os.kill, os.getpid(), signal.SIGINT)
Expand Down
1 change: 1 addition & 0 deletions requirements/testing/extra.txt
Expand Up @@ -6,3 +6,4 @@ nbformat!=5.0.0,!=5.0.1
pandas!=0.25.0
pikepdf
pytz
pywin32; sys.platform == 'win32'

0 comments on commit 852a63b

Please sign in to comment.