Commit 74f5b29e authored by Stefan H. Holek's avatar Stefan H. Holek

Provide access to test globs in doctest setUp and tearDown.

parent d46ab020
0.9.10 (Zope 2.11 edition) 0.9.10 (Zope 2.11 edition)
- Switched to Zope3 interfaces. - Switched to Zope3 interfaces.
- Removed broken profiler support. - Removed broken profiler support.
- Added hasPackage and installPackage functions for dealing with "products"
registered via five:registerPackage.
- Provide access to test globs in doctest setUp and tearDown.
0.9.9 (Zope 2.11 edition) 0.9.9 (Zope 2.11 edition)
- transaction.commit(1) is deprecated in favor of transaction.savepoint(1). - transaction.commit(1) is deprecated in favor of transaction.savepoint(1).
...@@ -18,8 +21,6 @@ ...@@ -18,8 +21,6 @@
publish_module(). Thanks to Andreas Zeidler. publish_module(). Thanks to Andreas Zeidler.
- Fixed doctestsuite factory to copy layers from test_class to the suite. - Fixed doctestsuite factory to copy layers from test_class to the suite.
Thanks to Whit Morris. Thanks to Whit Morris.
- Added hasPackage and installPackage functions for dealing with "products"
registered via five:registerPackage.
0.9.8 (Zope 2.8 edition) 0.9.8 (Zope 2.8 edition)
- Renamed 'doctest' package to 'zopedoctest' because of name-shadowing - Renamed 'doctest' package to 'zopedoctest' because of name-shadowing
......
...@@ -253,6 +253,7 @@ class ZopeSuiteFactory: ...@@ -253,6 +253,7 @@ class ZopeSuiteFactory:
if hasattr(test_instance, 'portal'): if hasattr(test_instance, 'portal'):
test.globs['portal'] = test_instance.portal test.globs['portal'] = test_instance.portal
test.globs['portal_name'] = test_instance.portal.getId() test.globs['portal_name'] = test_instance.portal.getId()
test_instance.globs = test.globs
if kwsetUp is not None: if kwsetUp is not None:
kwsetUp(test_instance) kwsetUp(test_instance)
......
...@@ -38,6 +38,9 @@ def setUp(self): ...@@ -38,6 +38,9 @@ def setUp(self):
Content-Type: text/plain; charset=... Content-Type: text/plain; charset=...
<BLANKLINE> <BLANKLINE>
index index
>>> foo
1
''' '''
self.folder.addDTMLDocument('index_html', file='index') self.folder.addDTMLDocument('index_html', file='index')
...@@ -55,6 +58,8 @@ def setUp(self): ...@@ -55,6 +58,8 @@ def setUp(self):
</dtml-in>''' </dtml-in>'''
self.folder.addDTMLMethod('show_cookies', file=show_cookies) self.folder.addDTMLMethod('show_cookies', file=show_cookies)
self.globs['foo'] = 1
def test_suite(): def test_suite():
return TestSuite(( return TestSuite((
......
...@@ -12,7 +12,7 @@ ...@@ -12,7 +12,7 @@
############################################################################## ##############################################################################
"""Example Zope doctest """Example Zope doctest
$Id: testZopeDocTest.py,v 1.2 2005/03/26 18:07:08 shh42 Exp $ $Id$
""" """
import os, sys import os, sys
...@@ -29,8 +29,12 @@ def setUp(self): ...@@ -29,8 +29,12 @@ def setUp(self):
>>> 'object' in folder.objectIds() >>> 'object' in folder.objectIds()
True True
>>> foo
1
''' '''
self.folder.manage_addFolder('object', '') self.folder.manage_addFolder('object', '')
self.globs['foo'] = 1
def test_suite(): 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