SVN: zope.testing/branches/ctheune-cleanup/src/zope/testing/testrunner/ Moved the self-test support out to its own feature.

Christian Theune <[email protected]>
Newsgroups gmane.comp.web.zope.zope3.cvs
Message-ID <[email protected]>
Log message for revision 86344:
  Moved the self-test support out to its own feature.
  
  

Changed:
  U   zope.testing/branches/ctheune-cleanup/src/zope/testing/testrunner/runner.py
  A   zope.testing/branches/ctheune-cleanup/src/zope/testing/testrunner/selftest.py

-=-
Modified: zope.testing/branches/ctheune-cleanup/src/zope/testing/testrunner/runner.py
===================================================================
--- zope.testing/branches/ctheune-cleanup/src/zope/testing/testrunner/runner.py	2008-05-04 12:14:42 UTC (rev 86343)
+++ zope.testing/branches/ctheune-cleanup/src/zope/testing/testrunner/runner.py	2008-05-04 12:16:41 UTC (rev 86344)
@@ -39,11 +39,9 @@
 import zope.testing.testrunner.coverage
 import zope.testing.testrunner.doctest
 import zope.testing.testrunner.logsupport
+import zope.testing.testrunner.selftest
 
 
-real_pdb_set_trace = pdb.set_trace
-
-
 PYREFCOUNT_PATTERN = re.compile('\[[0-9]+ refs\]')
 
 
@@ -170,6 +168,7 @@
         # XXX I moved this here mechanically.
         self.test_directories = test_dirs(self.options, {})
 
+        self.features.append(zope.testing.testrunner.selftest.SelfTest(self))
         self.features.append(zope.testing.testrunner.logsupport.Logging(self))
         self.features.append(zope.testing.testrunner.coverage.Coverage(self))
         self.features.append(zope.testing.testrunner.doctest.DocTest(self))
@@ -178,10 +177,6 @@
         self.features = [f for f in self.features if f.active]
 
     def setup_features(self):
-        # Make sure we start with real pdb.set_trace.  This is needed
-        # to make tests of the test runner work properly. :)
-        pdb.set_trace = real_pdb_set_trace
-
         # Setup profiling
         if (self.options.profile
             and sys.version_info[:3] <= (2,4,1)

Added: zope.testing/branches/ctheune-cleanup/src/zope/testing/testrunner/selftest.py
===================================================================
--- zope.testing/branches/ctheune-cleanup/src/zope/testing/testrunner/selftest.py	                        (rev 0)
+++ zope.testing/branches/ctheune-cleanup/src/zope/testing/testrunner/selftest.py	2008-05-04 12:16:41 UTC (rev 86344)
@@ -0,0 +1,34 @@
+##############################################################################
+#
+# Copyright (c) 2004-2008 Zope Corporation and Contributors.
+# All Rights Reserved.
+#
+# This software is subject to the provisions of the Zope Public License,
+# Version 2.1 (ZPL).  A copy of the ZPL should accompany this distribution.
+# THIS SOFTWARE IS PROVIDED "AS IS" AND ANY AND ALL EXPRESS OR IMPLIED
+# WARRANTIES ARE DISCLAIMED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+# WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS
+# FOR A PARTICULAR PURPOSE.
+#
+##############################################################################
+"""Self-test support.
+
+Provides setup routines that enable the test runner to test itself.
+
+$Id: __init__.py 86218 2008-05-03 14:17:26Z ctheune $
+"""
+
+import pdb
+from zope.testing import doctest
+import zope.testing.testrunner.feature
+
+real_pdb_set_trace = pdb.set_trace
+
+
+class SelfTest(zope.testing.testrunner.feature.Feature):
+
+    active = True
+
+    def global_setup(self):
+        # Make sure we start with real pdb.set_trace.
+        pdb.set_trace = real_pdb_set_trace


Property changes on: zope.testing/branches/ctheune-cleanup/src/zope/testing/testrunner/selftest.py
___________________________________________________________________
Name: svn:eol-style
   + native
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.