[Zope-Checkins] SVN: Zope/branches/five-integration/lib/python/Testing/ZopeTestCase/ztc_doctest/functional.py doctest._normalize_module() may guess wrongly if it isn't called by the first

Stefan H. Holek stefan at epy.co.at
Thu Mar 24 04:40:35 EST 2005


Log message for revision 29665:
  doctest._normalize_module() may guess wrongly if it isn't called by the first
  function on the call stack.
  

Changed:
  U   Zope/branches/five-integration/lib/python/Testing/ZopeTestCase/ztc_doctest/functional.py

-=-
Modified: Zope/branches/five-integration/lib/python/Testing/ZopeTestCase/ztc_doctest/functional.py
===================================================================
--- Zope/branches/five-integration/lib/python/Testing/ZopeTestCase/ztc_doctest/functional.py	2005-03-24 09:04:07 UTC (rev 29664)
+++ Zope/branches/five-integration/lib/python/Testing/ZopeTestCase/ztc_doctest/functional.py	2005-03-24 09:40:35 UTC (rev 29665)
@@ -168,7 +168,7 @@
     header_output.setResponseHeaders(response.headers)
 
     # Restore previous security manager, which may have been changed
-    # by calling the publish method above
+    # by calling the publish method above.
     setSecurityManager(old_sm)
 
     # Sync connection
@@ -186,6 +186,9 @@
 
     test_class = kw.get('test_class', FunctionalTestCase)
 
+    # Must call here or it may guess the package wrongly
+    kw['package'] = doctest._normalize_module(kw.get('package'))
+
     # If the passed-in test_class doesn't subclass Functional,
     # we mix it in for you, but we will issue a warning.
     if not issubclass(test_class, Functional):
@@ -219,7 +222,8 @@
     if 'test_class' in kw:
         del kw['test_class']
 
-    kw['package'] = doctest._normalize_module(kw.get('package'), depth=3)
+    # Must call here or it may guess the package wrongly
+    kw['package'] = doctest._normalize_module(kw.get('package'))
 
     kwsetUp = kw.get('setUp')
     def setUp(test):



More information about the Zope-Checkins mailing list