diff options
Diffstat (limited to 'sources/pyside2/tests')
| -rw-r--r-- | sources/pyside2/tests/QtGui/CMakeLists.txt | 2 | ||||
| -rw-r--r-- | sources/pyside2/tests/QtGui/timed_app_and_patching_test.py (renamed from sources/pyside2/tests/QtGui/timed_app_test.py) | 19 |
2 files changed, 20 insertions, 1 deletions
diff --git a/sources/pyside2/tests/QtGui/CMakeLists.txt b/sources/pyside2/tests/QtGui/CMakeLists.txt index 927e72468..172703ab9 100644 --- a/sources/pyside2/tests/QtGui/CMakeLists.txt +++ b/sources/pyside2/tests/QtGui/CMakeLists.txt @@ -46,4 +46,4 @@ PYSIDE_TEST(qtextdocumentwriter_test.py) PYSIDE_TEST(qtextline_test.py) PYSIDE_TEST(qtransform_test.py) PYSIDE_TEST(repr_test.py) -PYSIDE_TEST(timed_app_test.py) +PYSIDE_TEST(timed_app_and_patching_test.py) diff --git a/sources/pyside2/tests/QtGui/timed_app_test.py b/sources/pyside2/tests/QtGui/timed_app_and_patching_test.py index dc0e7c4b0..014aeec1a 100644 --- a/sources/pyside2/tests/QtGui/timed_app_test.py +++ b/sources/pyside2/tests/QtGui/timed_app_and_patching_test.py @@ -29,6 +29,10 @@ import unittest from helper import TimedQApplication +from PySide2.support import deprecated +from PySide2.support.signature import importhandler +from PySide2 import QtGui + class TestTimedApp(TimedQApplication): '''Simple test case for TimedQApplication''' @@ -37,5 +41,20 @@ class TestTimedApp(TimedQApplication): #Simple test of TimedQApplication self.app.exec_() + +def fix_for_QtGui(QtGui): + QtGui.something = 42 + +class TestPatchingFramework(unittest.TestCase): + """Simple test that verifies that deprecated.py works""" + + deprecated.fix_for_QtGui = fix_for_QtGui + + def test_patch_works(self): + something = "something" + self.assertFalse(hasattr(QtGui, something)) + importhandler.finish_import(QtGui) + self.assertTrue(hasattr(QtGui, something)) + if __name__ == '__main__': unittest.main() |
