Browse Source

Use a different function to demonstrate AssertionError.

add() statements may take longer than general other commands.

Conflicts:
	funtests/stress/stress/suite.py
Roger Hu 10 years ago
parent
commit
5fdb5b5349
2 changed files with 9 additions and 7 deletions
  1. 1 1
      funtests/stress/stress/app.py
  2. 8 6
      funtests/stress/stress/suite.py

+ 1 - 1
funtests/stress/stress/app.py

@@ -110,7 +110,7 @@ def retries(self):
 
 
 @app.task
-def unicode():
+def print_unicode():
     print('hiöäüß')
 
 

+ 8 - 6
funtests/stress/stress/suite.py

@@ -19,7 +19,7 @@ from celery.utils.timeutils import humanize_seconds
 
 from .app import (
     marker, _marker, add, any_, exiting, kill, sleeping,
-    sleeping_ignore_limits, any_returning,
+    sleeping_ignore_limits, any_returning, print_unicode
 )
 from .data import BIG, SMALL
 from .fbi import FBI
@@ -103,11 +103,11 @@ class BaseSuite(object):
                 except AttributeError:
                     pass
                 else:
-                    for group in groups:
-                        acc[group].append(meth)
+                    for g in groups:
+                        acc[g].append(meth)
         # sort the tests by the order in which they are defined in the class
-        for group in values(acc):
-            group[:] = sorted(group, key=lambda m: m.__func__.__testsort__)
+        for g in values(acc):
+            g[:] = sorted(g, key=lambda m: m.__func__.__testsort__)
         self.groups = dict(
             (name, testgroup(*tests)) for name, tests in items(acc)
         )
@@ -236,6 +236,8 @@ class BaseSuite(object):
 
 
 _creation_counter = count(0)
+
+
 def testcase(*groups):
     if not groups:
         raise ValueError('@testcase requires at least one group name')
@@ -262,7 +264,7 @@ class Suite(BaseSuite):
 
     @testcase('all', 'green')
     def manyshort(self):
-        self.join(group(add.s(i, i) for i in range(1000))(),
+        self.join(group(print_unicode.s(i, i) for i in range(1000))(),
                   timeout=10, propagate=True)
 
     @testcase('all')