Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 6d394df

Browse files
authored
Merge pull request #20883 from QuLogic/qt-interrupt-cleanup
Make pywin32 optional in Ctrl+C Qt test.
2 parents 662148f + 852a63b commit 6d394df

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

lib/matplotlib/tests/test_backend_qt.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,8 +39,8 @@ def platform_simulate_ctrl_c(request):
3939
from functools import partial
4040

4141
if hasattr(signal, "CTRL_C_EVENT"):
42-
from win32api import GenerateConsoleCtrlEvent
43-
return partial(GenerateConsoleCtrlEvent, 0, 0)
42+
win32api = pytest.importorskip('win32api')
43+
return partial(win32api.GenerateConsoleCtrlEvent, 0, 0)
4444
else:
4545
# we're not on windows
4646
return partial(os.kill, os.getpid(), signal.SIGINT)

requirements/testing/extra.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,3 +6,4 @@ nbformat!=5.0.0,!=5.0.1
66
pandas!=0.25.0
77
pikepdf
88
pytz
9+
pywin32; sys.platform == 'win32'

0 commit comments

Comments
 (0)