[Checkins] SVN: z3c.testsetup/branches/new_markers/src/z3c/testsetup/doctesting.py Emit a warning if zope.app.testing is not available.

Uli Fouquet uli at gnufix.de
Tue Jan 6 10:48:55 EST 2009


Log message for revision 94546:
  Emit a warning if zope.app.testing is not available.

Changed:
  U   z3c.testsetup/branches/new_markers/src/z3c/testsetup/doctesting.py

-=-
Modified: z3c.testsetup/branches/new_markers/src/z3c/testsetup/doctesting.py
===================================================================
--- z3c.testsetup/branches/new_markers/src/z3c/testsetup/doctesting.py	2009-01-05 23:30:17 UTC (rev 94545)
+++ z3c.testsetup/branches/new_markers/src/z3c/testsetup/doctesting.py	2009-01-06 15:48:55 UTC (rev 94546)
@@ -75,10 +75,21 @@
                 common_prefix = os.path.commonprefix([self.package.__file__,
                                                       name])
                 name = name[len(common_prefix):]
+
             suite_creator = doctest.DocFileSuite
             if functional_zcml_layer is not None:
-                from zope.app.testing.functional import FunctionalDocFileSuite
+                try:
+                    from zope.app.testing.functional import (
+                        FunctionalDocFileSuite)
+                except ImportError:
+                    warn("""You specified `:functional-zcml-layer:` in
+    %s
+but there seems to be no `zope.app.testing` package available.
+Please include `zope.app.testing` in your project setup to run this testfile.
+""" % (os.path.join(common_prefix, name),))
+                    continue
                 suite_creator = FunctionalDocFileSuite
+                
             test = suite_creator(
                 name,
                 package=self.package,



More information about the Checkins mailing list