Changeset 689
- Timestamp:
- 09/28/05 11:59:32
- Files:
-
- trunk/cherrypy/test/helper.py (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/cherrypy/test/helper.py
r682 r689 184 184 CPTestRunner = webtest.TerseTestRunner(verbosity=2) 185 185 186 187 def run_test_suite(moduleNames, server, conf): 188 """Run the given test modules using the given server and conf. 189 190 The server is started and stopped once, regardless of the number 191 of test modules. The config, however, is reset for each module. 192 """ 186 def setConfig(conf): 187 """Set the config using a copy of conf.""" 193 188 if isinstance(conf, basestring): 194 189 # assume it's a filename … … 196 191 else: 197 192 cherrypy.config.update(conf.copy()) 193 194 def run_test_suite(moduleNames, server, conf): 195 """Run the given test modules using the given server and conf. 196 197 The server is started and stopped once, regardless of the number 198 of test modules. The config, however, is reset for each module. 199 """ 200 setConfig(conf) 198 201 startServer(server) 199 202 for testmod in moduleNames: … … 201 204 # because each module uses/overwrites cherrypy globals. 202 205 cherrypy.config.reset() 203 if isinstance(conf, basestring): 204 cherrypy.config.update(file=conf) 205 else: 206 cherrypy.config.update(conf.copy()) 206 setConfig(conf) 207 207 cherrypy._cputil._cpInitDefaultFilters() 208 208 … … 216 216 if conf is None: 217 217 conf = {} 218 if isinstance(conf, basestring): 219 # assume it's a filename 220 cherrypy.config.update(file=conf) 221 else: 222 cherrypy.config.update(conf.copy()) 218 setConfig(conf) 223 219 224 220 startServer(server)

