@@ -93,10 +93,10 @@ def test_other_signal_before_sigint(qt_core, platform_simulate_ctrl_c,
9393 def custom_sigpipe_handler (signum , frame ):
9494 nonlocal sigcld_caught
9595 sigcld_caught = True
96- signal .signal (signal .SIGCLD , custom_sigpipe_handler )
96+ signal .signal (signal .SIGCHLD , custom_sigpipe_handler )
9797
9898 def fire_other_signal ():
99- os .kill (os .getpid (), signal .SIGCLD )
99+ os .kill (os .getpid (), signal .SIGCHLD )
100100
101101 def fire_sigint ():
102102 platform_simulate_ctrl_c ()
@@ -166,24 +166,33 @@ def custom_handler(signum, frame):
166166
167167
168168@pytest .mark .parametrize (
169- ' qt_key, qt_mods, answer' ,
169+ " qt_key, qt_mods, answer" ,
170170 [
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+ ),
182187 # We do not currently map the media keys, this may change in the
183188 # 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+ ),
187196 ],
188197 ids = [
189198 'shift' ,
@@ -216,6 +225,11 @@ def test_correct_key(backend, qt_core, qt_key, qt_mods, answer):
216225 Assert sent and caught keys are the same.
217226 """
218227 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" )
219233 result = None
220234 qt_mod = _enum ("QtCore.Qt.KeyboardModifier" ).NoModifier
221235 for mod in qt_mods :
0 commit comments