@pytest.mark.parametrize('key, modifiers, text, filtered', [(Qt.Key_A, Qt.NoModifier, 'a', True), (Qt.Key_Up, Qt.NoModifier, '', False), (Qt.Key_A, Qt.ShiftModifier, 'A', True), (Qt.Key_A, (Qt.ShiftModifier | Qt.ControlModifier), 'x', False)])
def test_non_alphanumeric(key, modifiers, text, filtered, fake_keyevent_factory, modeman):
 evt = fake_keyevent_factory(key=key, modifiers=modifiers, text=text)
 assert (modeman.eventFilter(evt) == filtered)

@ pytest . mark . parametrize ( 'key, modifiers, text, filtered' , [ ( Qt . Key_A , Qt . NoModifier , 'a' , True ) , ( Qt . Key_Up , Qt . NoModifier , '' , False ) , ( Qt . Key_A , Qt . ShiftModifier , 'A' , True ) , ( Qt . Key_A , ( Qt . ShiftModifier | Qt . ControlModifier ) , 'x' , False ) ] ) def test_non_alphanumeric ( key , modifiers , text , filtered , fake_keyevent_factory , modeman ) : evt = fake_keyevent_factory ( key = key , modifiers = modifiers , text = text ) assert ( modeman . eventFilter ( evt ) == filtered )
make sure non-alphanumeric keys are passed through correctly .