[Zope-Checkins]
SVN: Zope/branches/Zope-2_8-branch/lib/python/Testing/ZopeTestCase/
Provide access to test globs in doctest setUp and tearDown.
Stefan H. Holek
stefan at epy.co.at
Sat Jun 23 13:46:58 EDT 2007
Log message for revision 76992:
Provide access to test globs in doctest setUp and tearDown.
Changed:
U Zope/branches/Zope-2_8-branch/lib/python/Testing/ZopeTestCase/doc/CHANGES.txt
U Zope/branches/Zope-2_8-branch/lib/python/Testing/ZopeTestCase/zopedoctest/functional.py
U Zope/branches/Zope-2_8-branch/lib/python/Testing/ZopeTestCase/zopedoctest/testFunctionalDocTest.py
U Zope/branches/Zope-2_8-branch/lib/python/Testing/ZopeTestCase/zopedoctest/testZopeDocTest.py
-=-
Modified: Zope/branches/Zope-2_8-branch/lib/python/Testing/ZopeTestCase/doc/CHANGES.txt
===================================================================
--- Zope/branches/Zope-2_8-branch/lib/python/Testing/ZopeTestCase/doc/CHANGES.txt 2007-06-23 17:26:25 UTC (rev 76991)
+++ Zope/branches/Zope-2_8-branch/lib/python/Testing/ZopeTestCase/doc/CHANGES.txt 2007-06-23 17:46:57 UTC (rev 76992)
@@ -11,6 +11,7 @@
- Added placeless.py for Z3-style setup. Thanks to Whit Morriss.
- Fixed functional.http() to only pass the request body (no headers) to
publish_module(). Thanks to Andreas Zeidler.
+- 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
Modified: Zope/branches/Zope-2_8-branch/lib/python/Testing/ZopeTestCase/zopedoctest/functional.py
===================================================================
--- Zope/branches/Zope-2_8-branch/lib/python/Testing/ZopeTestCase/zopedoctest/functional.py 2007-06-23 17:26:25 UTC (rev 76991)
+++ Zope/branches/Zope-2_8-branch/lib/python/Testing/ZopeTestCase/zopedoctest/functional.py 2007-06-23 17:46:57 UTC (rev 76992)
@@ -249,6 +249,7 @@
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)
Modified: Zope/branches/Zope-2_8-branch/lib/python/Testing/ZopeTestCase/zopedoctest/testFunctionalDocTest.py
===================================================================
--- Zope/branches/Zope-2_8-branch/lib/python/Testing/ZopeTestCase/zopedoctest/testFunctionalDocTest.py 2007-06-23 17:26:25 UTC (rev 76991)
+++ Zope/branches/Zope-2_8-branch/lib/python/Testing/ZopeTestCase/zopedoctest/testFunctionalDocTest.py 2007-06-23 17:46:57 UTC (rev 76992)
@@ -38,6 +38,9 @@
Content-Type: text/plain
<BLANKLINE>
index
+
+ >>> foo
+ 1
'''
self.folder.addDTMLDocument('index_html', file='index')
@@ -55,7 +58,9 @@
</dtml-in>'''
self.folder.addDTMLMethod('show_cookies', file=show_cookies)
+ self.globs['foo'] = 1
+
def test_suite():
return TestSuite((
FunctionalDocTestSuite(setUp=setUp),
Modified: Zope/branches/Zope-2_8-branch/lib/python/Testing/ZopeTestCase/zopedoctest/testZopeDocTest.py
===================================================================
--- Zope/branches/Zope-2_8-branch/lib/python/Testing/ZopeTestCase/zopedoctest/testZopeDocTest.py 2007-06-23 17:26:25 UTC (rev 76991)
+++ Zope/branches/Zope-2_8-branch/lib/python/Testing/ZopeTestCase/zopedoctest/testZopeDocTest.py 2007-06-23 17:46:57 UTC (rev 76992)
@@ -12,7 +12,7 @@
##############################################################################
"""Example Zope doctest
-$Id: testZopeDocTest.py,v 1.2 2005/03/26 18:07:08 shh42 Exp $
+$Id$
"""
import os, sys
@@ -29,8 +29,12 @@
>>> 'object' in folder.objectIds()
True
+
+ >>> foo
+ 1
'''
self.folder.manage_addFolder('object', '')
+ self.globs['foo'] = 1
def test_suite():
More information about the Zope-Checkins
mailing list