Commit 6c2cadb7 authored by Stefan H. Holek's avatar Stefan H. Holek

Provide access to test globs in doctest setUp and tearDown.

parent 3d570d23
......@@ -14,6 +14,7 @@
publish_module(). Thanks to Andreas Zeidler.
- Fixed doctestsuite factory to copy layers from test_class to the suite.
Thanks to Whit Morris.
- Provide access to test globs in doctest setUp and tearDown.
0.9.8 (Zope 2.8 edition)
- Renamed 'doctest' package to 'zopedoctest' because of name-shadowing
......
......@@ -261,6 +261,7 @@ class ZopeSuiteFactory:
if hasattr(test_instance, 'portal'):
test.globs['portal'] = test_instance.portal
test.globs['portal_name'] = test_instance.portal.getId()
test_instance.globs = test.globs
if kwsetUp is not None:
kwsetUp(test_instance)
......
......@@ -38,6 +38,9 @@ def setUp(self):
Content-Type: text/plain; charset=...
<BLANKLINE>
index
>>> foo
1
'''
self.folder.addDTMLDocument('index_html', file='index')
......@@ -55,6 +58,8 @@ def setUp(self):
</dtml-in>'''
self.folder.addDTMLMethod('show_cookies', file=show_cookies)
self.globs['foo'] = 1
def test_suite():
return TestSuite((
......
......@@ -29,8 +29,12 @@ def setUp(self):
>>> 'object' in folder.objectIds()
True
>>> foo
1
'''
self.folder.manage_addFolder('object', '')
self.globs['foo'] = 1
def test_suite():
......
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