[Checkins] SVN: z3c.testsetup/branches/ulif-deprecation-warnings/src/z3c/testsetup/doctesting.py Emit deprecation warnings for unit-tests.

Uli Fouquet uli at gnufix.de
Thu Sep 24 04:41:59 EDT 2009


Log message for revision 104476:
  Emit deprecation warnings for unit-tests.
  

Changed:
  U   z3c.testsetup/branches/ulif-deprecation-warnings/src/z3c/testsetup/doctesting.py

-=-
Modified: z3c.testsetup/branches/ulif-deprecation-warnings/src/z3c/testsetup/doctesting.py
===================================================================
--- z3c.testsetup/branches/ulif-deprecation-warnings/src/z3c/testsetup/doctesting.py	2009-09-24 08:41:00 UTC (rev 104475)
+++ z3c.testsetup/branches/ulif-deprecation-warnings/src/z3c/testsetup/doctesting.py	2009-09-24 08:41:58 UTC (rev 104476)
@@ -19,7 +19,7 @@
 from zope.testing import doctest, cleanup
 from z3c.testsetup.base import BasicTestSetup
 from z3c.testsetup.util import (get_package, get_marker_from_file, warn,
-                                get_attribute)
+                                get_attribute, emit_deprecation_warning)
 
 class DocTestSetup(BasicTestSetup):
     """A test setup for doctests."""
@@ -227,6 +227,15 @@
                 common_prefix = os.path.commonprefix([self.package.__file__,
                                                       name])
                 name = name[len(common_prefix):]
+            emit_deprecation_warning(
+                "Usage of ':Test-Layer: unit' is deprecated. " +
+                "Use :doctest: instead.",
+                package=self.package, filename=name)
+            if layerdef is not None:
+                emit_deprecation_warning(
+                    "Usage of ':Test-Layerdef:' is deprecated. " +
+                    "Use :layer: instead.",
+                    package=self.package, filename=name)
             test = doctest.DocFileSuite(
                 name,
                 package=self.package,



More information about the checkins mailing list