- Timestamp:
- 30 May 2011, 01:14:13 (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
main/waeup.sirp/trunk/src/waeup/sirp/testing.py
r6237 r6238 1 1 """Testing support for :mod:`waeup.sirp`. 2 2 """ 3 import grok 4 import doctest 3 5 import os.path 6 import re 4 7 import warnings 5 import grok6 8 import zope.component 7 9 import waeup.sirp 8 from zope.app.testing.functional import ZCMLLayer 10 from zope.app.testing.functional import ( 11 ZCMLLayer, FunctionalTestSetup, getRootFolder, sync) 9 12 from zope.component import getGlobalSiteManager 10 13 from zope.security.testing import addCheckerPublic 14 from zope.testing import renormalizing 11 15 from zope.testing.cleanup import cleanUp 12 16 … … 174 178 def tearDown(cls): 175 179 cleanUpZope(None) 180 181 checker = renormalizing.RENormalizing([ 182 # Relevant normalizers from zope.testing.testrunner.tests: 183 (re.compile(r'\d+[.]\d\d\d seconds'), 'N.NNN seconds'), 184 # Our own one to work around 185 # http://reinout.vanrees.org/weblog/2009/07/16/invisible-test-diff.html: 186 (re.compile(r'.*1034h'), ''), 187 (re.compile(r'httperror_seek_wrapper:'), 'HTTPError:' ) 188 ]) 189 190 def setUp(test): 191 FunctionalTestSetup().setUp() 192 193 def tearDown(test): 194 FunctionalTestSetup().tearDown() 195 196 def doctestsuite_for_module(dotted_path): 197 """Create a doctest suite for the module at `dotted_path`. 198 """ 199 test = doctest.DocTestSuite( 200 dotted_path, 201 setUp = setUp, 202 tearDown = tearDown, 203 checker = checker, 204 extraglobs = dict( 205 getRootFolder=getRootFolder, 206 sync=sync,), 207 optionflags = (doctest.ELLIPSIS + 208 doctest.NORMALIZE_WHITESPACE + 209 doctest.REPORT_NDIFF), 210 ) 211 test.layer = FunctionalLayer 212 return test
Note: See TracChangeset for help on using the changeset viewer.