@@ -93,10 +93,10 @@ def test_other_signal_before_sigint(qt_core, platform_simulate_ctrl_c,
93
93
def custom_sigpipe_handler (signum , frame ):
94
94
nonlocal sigcld_caught
95
95
sigcld_caught = True
96
- signal .signal (signal .SIGCLD , custom_sigpipe_handler )
96
+ signal .signal (signal .SIGCHLD , custom_sigpipe_handler )
97
97
98
98
def fire_other_signal ():
99
- os .kill (os .getpid (), signal .SIGCLD )
99
+ os .kill (os .getpid (), signal .SIGCHLD )
100
100
101
101
def fire_sigint ():
102
102
platform_simulate_ctrl_c ()
@@ -166,24 +166,33 @@ def custom_handler(signum, frame):
166
166
167
167
168
168
@pytest .mark .parametrize (
169
- ' qt_key, qt_mods, answer' ,
169
+ " qt_key, qt_mods, answer" ,
170
170
[
171
- ('Key_A' , ['ShiftModifier' ], 'A' ),
172
- ('Key_A' , [], 'a' ),
173
- ('Key_A' , ['ControlModifier' ], 'ctrl+a' ),
174
- ('Key_Aacute' , ['ShiftModifier' ],
175
- '\N{LATIN CAPITAL LETTER A WITH ACUTE} ' ),
176
- ('Key_Aacute' , [],
177
- '\N{LATIN SMALL LETTER A WITH ACUTE} ' ),
178
- ('Key_Control' , ['AltModifier' ], 'alt+control' ),
179
- ('Key_Alt' , ['ControlModifier' ], 'ctrl+alt' ),
180
- ('Key_Aacute' , ['ControlModifier' , 'AltModifier' , 'MetaModifier' ],
181
- 'ctrl+alt+meta+\N{LATIN SMALL LETTER A WITH ACUTE} ' ),
171
+ ("Key_A" , ["ShiftModifier" ], "A" ),
172
+ ("Key_A" , [], "a" ),
173
+ ("Key_A" , ["ControlModifier" ], ("ctrl+a" )),
174
+ (
175
+ "Key_Aacute" ,
176
+ ["ShiftModifier" ],
177
+ "\N{LATIN CAPITAL LETTER A WITH ACUTE} " ,
178
+ ),
179
+ ("Key_Aacute" , [], "\N{LATIN SMALL LETTER A WITH ACUTE} " ),
180
+ ("Key_Control" , ["AltModifier" ], ("alt+control" )),
181
+ ("Key_Alt" , ["ControlModifier" ], "ctrl+alt" ),
182
+ (
183
+ "Key_Aacute" ,
184
+ ["ControlModifier" , "AltModifier" , "MetaModifier" ],
185
+ ("ctrl+alt+meta+\N{LATIN SMALL LETTER A WITH ACUTE} " ),
186
+ ),
182
187
# We do not currently map the media keys, this may change in the
183
188
# future. This means the callback will never fire
184
- ('Key_Play' , [], None ),
185
- ('Key_Backspace' , [], 'backspace' ),
186
- ('Key_Backspace' , ['ControlModifier' ], 'ctrl+backspace' ),
189
+ ("Key_Play" , [], None ),
190
+ ("Key_Backspace" , [], "backspace" ),
191
+ (
192
+ "Key_Backspace" ,
193
+ ["ControlModifier" ],
194
+ "ctrl+backspace" ,
195
+ ),
187
196
],
188
197
ids = [
189
198
'shift' ,
@@ -216,6 +225,11 @@ def test_correct_key(backend, qt_core, qt_key, qt_mods, answer):
216
225
Assert sent and caught keys are the same.
217
226
"""
218
227
from matplotlib .backends .qt_compat import _enum , _to_int
228
+
229
+ if sys .platform == "darwin" and answer is not None :
230
+ answer = answer .replace ("ctrl" , "cmd" )
231
+ answer = answer .replace ("control" , "cmd" )
232
+ answer = answer .replace ("meta" , "ctrl" )
219
233
result = None
220
234
qt_mod = _enum ("QtCore.Qt.KeyboardModifier" ).NoModifier
221
235
for mod in qt_mods :
0 commit comments