Source

trac-rpc-mq / t0000 / t0000-concurrent-tests-r7971.diff

Full commit
Support for concurrent tests.

diff -r a4e50ecb1bae trunk/tracrpc/tests/__init__.py
--- a/trunk/tracrpc/tests/__init__.py	Fri Sep 17 19:43:29 2010 -0400
+++ b/trunk/tracrpc/tests/__init__.py	Sat Sep 18 18:43:58 2010 -0400
@@ -58,9 +58,11 @@
             if do_wait: # Delay to ensure command executes and caches resets
                 time.sleep(5)
 
+    port = os.environ.get('TRACRPC_TEST_PORT') or '8765'
+    envname = 'rpctestenv_' + port
     rpc_testenv = RpcTestEnvironment(os.path.realpath(os.path.join(
-                os.path.realpath(__file__), '..', '..', '..', 'rpctestenv')),
-                '8765', 'http://127.0.0.1')
+                os.path.realpath(__file__), '..', '..', '..', envname)),
+                port, 'http://127.0.0.1')
 
     def test_suite():
         suite = unittest.TestSuite()