Commit e7a25d34 authored by Stefan H. Holek's avatar Stefan H. Holek

doctest._normalize_module() may guess wrongly if it isn't called by the first

function on the call stack.
parent f8c45562
......@@ -168,7 +168,7 @@ def http(request_string, handle_errors=True):
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 @@ def FunctionalDocFileSuite(*paths, **kw):
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 @@ def ZopeDocFileSuite(*paths, **kw):
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):
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment