diff options
Diffstat (limited to 'tests/QtGui/bug_674.py')
-rw-r--r-- | tests/QtGui/bug_674.py | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/tests/QtGui/bug_674.py b/tests/QtGui/bug_674.py new file mode 100644 index 000000000..4d015b577 --- /dev/null +++ b/tests/QtGui/bug_674.py @@ -0,0 +1,23 @@ +from PySide.QtCore import * +from PySide.QtGui import * +import unittest +import sys + +class TestBug679(unittest.TestCase): + '''QGraphicsScene::clear() is missing''' + def testIt(self): + app = QApplication([]) + + scene = QGraphicsScene() + hello = scene.addText("Hello") + scene.addText("World") + + self.assertEqual(sys.getrefcount(hello), 3) + scene.clear() + self.assertEqual(sys.getrefcount(hello), 2) + self.assertEqual(len(scene.items()), 0) + self.assertRaises(RuntimeError, hello.isVisible) # the C++ object was deleted + +if __name__ == '__main__': + unittest.main() + |