aboutsummaryrefslogtreecommitdiffstats
path: root/tests/signals/bug_312.py
diff options
context:
space:
mode:
authorRenato Filho <renato.filho@openbossa.org>2011-08-03 20:16:20 -0300
committerHugo Parente Lima <hugo.pl@gmail.com>2012-03-08 16:54:42 -0300
commita713e377bbc0cdbceb3b90b32037a6f28c68c0e1 (patch)
tree3b4148f99cdad155b1a9301203a351ff38529048 /tests/signals/bug_312.py
parentfae2dfd9b1bc948b72b4a34469a6e0e08e12a30f (diff)
DynamicMetaObject optimizations.
Reviewer: Marcelo Lira <marcelo.lira@openbossa.org> Luciano Wolf <luciano.wolf@openbossa.org>
Diffstat (limited to 'tests/signals/bug_312.py')
-rw-r--r--tests/signals/bug_312.py15
1 files changed, 10 insertions, 5 deletions
diff --git a/tests/signals/bug_312.py b/tests/signals/bug_312.py
index 46b64fa10..3aa54cef3 100644
--- a/tests/signals/bug_312.py
+++ b/tests/signals/bug_312.py
@@ -5,6 +5,9 @@ import unittest
import sys
from PySide.QtCore import QObject, SIGNAL
+MAX_LOOPS = 5
+MAX_OBJECTS = 200
+
class Dummy(object):
def __init__(self, parent):
self._parent = parent
@@ -16,26 +19,28 @@ class MultipleSlots(unittest.TestCase):
def myCB(self):
self._count += 1
+ """
def testUnboundSignal(self):
o = QObject()
self._count = 0
- for i in range(200):
+ for i in range(MAX_OBJECTS):
QObject.connect(o, SIGNAL("fire()"), lambda: self.myCB())
o.emit(SIGNAL("fire()"))
- self.assertEqual(self._count, 200)
+ self.assertEqual(self._count, MAX_OBJECTS)
+ """
def testDisconnectCleanup(self):
- for c in range(5):
+ for c in range(MAX_LOOPS):
self._count = 0
self._senders = []
- for i in range(200):
+ for i in range(MAX_OBJECTS):
o = QObject()
QObject.connect(o, SIGNAL("fire()"), lambda: self.myCB())
self._senders.append(o)
o.emit(SIGNAL("fire()"))
- self.assertEqual(self._count, 200)
+ self.assertEqual(self._count, MAX_OBJECTS)
#delete all senders will disconnect the signals
self._senders = []