SVN: ZODB/trunk/src/ZEO/tests/testZEO.py Tweaked the multi-processing test to run in it's own layer, to reduce

Jim Fulton <[email protected]>
Newsgroups gmane.comp.python.zope.zodb.cvs
Message-ID <20100202165048.4BB7D941AF__33182.3642286055$1265129461$gmane$org@cvs.zope.org>
Log message for revision 108721:
  Tweaked the multi-processing test to run in it's own layer, to reduce
  chance of affecting other tests, at least when run in a separate
  process via the -j runner option.
  

Changed:
  U   ZODB/trunk/src/ZEO/tests/testZEO.py

-=-
Modified: ZODB/trunk/src/ZEO/tests/testZEO.py
===================================================================
--- ZODB/trunk/src/ZEO/tests/testZEO.py	2010-02-02 16:50:46 UTC (rev 108720)
+++ ZODB/trunk/src/ZEO/tests/testZEO.py	2010-02-02 16:50:48 UTC (rev 108721)
@@ -1268,9 +1268,15 @@
 
     class MultiprocessingTests(unittest.TestCase):
 
+        layer = ZODB.tests.util.MininalTestLayer('work_with_multiprocessing')
+
         def test_work_with_multiprocessing(self):
             "Client storage should work with multi-processing."
 
+            # Gaaa, zope.testing.runner.FakeInputContinueGenerator has no close
+            if not hasattr(sys.stdin, 'close'):
+                sys.stdin.close = lambda : None
+
             self.globs = {}
             forker.setUp(self)
             addr, adminaddr = self.globs['start_server']()
@@ -1364,7 +1370,6 @@
     # unit test layer
     zeo = unittest.TestSuite()
     zeo.addTest(unittest.makeSuite(ZODB.tests.util.AAAA_Test_Runner_Hack))
-    zeo.addTest(unittest.makeSuite(MultiprocessingTests))
     zeo.addTest(doctest.DocTestSuite(
         setUp=forker.setUp, tearDown=zope.testing.setupstack.tearDown))
     zeo.addTest(doctest.DocTestSuite(ZEO.tests.IterationTests,
@@ -1388,6 +1393,8 @@
     zeo.layer = ZODB.tests.util.MininalTestLayer('testZeo-misc')
     suite.addTest(zeo)
 
+    suite.addTest(unittest.makeSuite(MultiprocessingTests))
+
     # Put the heavyweights in their own layers
     for klass in slow_test_classes:
         sub = unittest.makeSuite(klass, "check")
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.