[Zope3-checkins] SVN: Zope3/trunk/src/zope/app/recorder/tests.py The recorder tests changed the publication class on the test request class

Stephan Richter srichter at cosmos.phy.tufts.edu
Fri Apr 8 15:47:40 EDT 2005


Log message for revision 29924:
  The recorder tests changed the publication class on the test request class 
  (and not an instance), which caused tests to fail when run with "-N 2".
  
  

Changed:
  U   Zope3/trunk/src/zope/app/recorder/tests.py

-=-
Modified: Zope3/trunk/src/zope/app/recorder/tests.py
===================================================================
--- Zope3/trunk/src/zope/app/recorder/tests.py	2005-04-08 19:17:34 UTC (rev 29923)
+++ Zope3/trunk/src/zope/app/recorder/tests.py	2005-04-08 19:47:40 UTC (rev 29924)
@@ -90,15 +90,19 @@
 def doctest_RecordingHTTPServer():
     r"""Unit tests for RecordingHTTPServer.
 
-    RecordingHTTPServer is a very thin wrapper over PublisherHTTPServer.  To
-    keep things simple, we will override the constructor and prevent it from
-    listening on sockets.
+    RecordingHTTPServer is a very thin wrapper over PublisherHTTPServer. First
+    we create a custom request:
 
+        >>> class RecorderRequest(TestRequest):
+        ...     publication = PublicationStub()
+
+    Further, to keep things simple, we will override the constructor and
+    prevent it from listening on sockets.
+
         >>> from zope.app.recorder import RecordingHTTPServer
         >>> class RecordingHTTPServerForTests(RecordingHTTPServer):
         ...     def __init__(self):
-        ...         self.request_factory = TestRequest
-        ...         self.request_factory.publication = PublicationStub()
+        ...         self.request_factory = RecorderRequest
         >>> server = RecordingHTTPServerForTests()
 
     We will need a request parser



More information about the Zope3-Checkins mailing list