From e217e6a89198e7c1057a72f913fa1879579e1f02 Mon Sep 17 00:00:00 2001 From: Thomas Ferreira de Lima Date: Sat, 22 Sep 2018 14:14:08 -0400 Subject: [PATCH] [skip ci] fixing test test_42 in qtbinding.py and adding note to qtbinding.rb Sorry, don't know ruby --- testdata/python/qtbinding.py | 8 +++++--- testdata/ruby/qtbinding.rb | 5 ++++- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/testdata/python/qtbinding.py b/testdata/python/qtbinding.py index 77ec69173..a077656e4 100644 --- a/testdata/python/qtbinding.py +++ b/testdata/python/qtbinding.py @@ -471,9 +471,11 @@ class QtBindingTest(unittest.TestCase): pya.QApplication.processEvents() - s1 = "QKeyEvent: ShortcutOverride (51)\nQKeyEvent: KeyPress (6)\nQKeyEvent: ShortcutOverride (51)\nQKeyEvent: KeyPress (6)\nQKeyEvent: ShortcutOverride (51)\nQKeyEvent: KeyPress (6)" - s2 = "QKeyEvent: KeyPress (6)\nQKeyEvent: KeyPress (6)\nQKeyEvent: KeyPress (6)" - self.assertEqual("\n".join(ef.log()) == s1 or "\n".join(ef.log()) == s2, True) + s1 = "QKeyEvent: ShortcutOverride (51)\nQKeyEvent: KeyPress (6)\nQKeyEvent: ShortcutOverride (51)\nQKeyEvent: KeyPress (6)\nQKeyEvent: ShortcutOverride (51)\nQKeyEvent: KeyPress (6)" + s2 = "QKeyEvent: KeyPress (6)\nQKeyEvent: KeyPress (6)\nQKeyEvent: KeyPress (6)" + s3 = "QKeyEvent_Native: ShortcutOverride (51)\nQKeyEvent: KeyPress (6)\nQKeyEvent_Native: ShortcutOverride (51)\nQKeyEvent: KeyPress (6)\nQKeyEvent_Native: ShortcutOverride (51)\nQKeyEvent: KeyPress (6)" + self.assertIn("\n".join(ef.log()), (s1, s2, s3)) + ef = None self.assertEqual(widget.text, "ABCpO") diff --git a/testdata/ruby/qtbinding.rb b/testdata/ruby/qtbinding.rb index 884f05e7b..e8d044dee 100644 --- a/testdata/ruby/qtbinding.rb +++ b/testdata/ruby/qtbinding.rb @@ -534,7 +534,10 @@ class QtBinding_TestClass < TestBase GC.start - assert_equal(ef.log.select { |s| s !~ /RBA::QKeyEvent: ShortcutOverride/ }.join("\n"), "RBA::QKeyEvent: KeyPress (6)\nRBA::QKeyEvent: KeyPress (6)\nRBA::QKeyEvent: KeyPress (6)") + assert_equal(ef.log.select { |s| s !~ /RBA::QKeyEvent: ShortcutOverride/ }.join("\n"), "RBA::QKeyEvent: KeyPress (6)\nRBA::QKeyEvent: KeyPress (6)\nRBA::QKeyEvent: KeyPress (6)") + + # TODO: on macOS 10.13, ef.log yields "RBA::QKeyEvent_Native: ShortcutOverride (51)\nRBA::QKeyEvent: KeyPress (6)\nRBA::QKeyEvent_Native: ShortcutOverride (51)\nRBA::QKeyEvent: KeyPress (6)\nRBA::QKeyEvent_Native: ShortcutOverride (51)\nRBA::QKeyEvent: KeyPress (6)", causing this test to fail. + ef = nil ef = EventFilter::new GC.start