Changeset 1403
- Timestamp:
- 10/20/06 13:46:12
- Files:
-
- trunk/cherrypy/test/helper.py (modified) (4 diffs)
- trunk/cherrypy/test/test.py (modified) (6 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/cherrypy/test/helper.py
r1392 r1403 120 120 return 1 121 121 122 def sync_apps(profile=False, validate=False ):122 def sync_apps(profile=False, validate=False, conquer=False): 123 123 apps = [] 124 124 for base, app in cherrypy.tree.apps.iteritems(): … … 127 127 if profile: 128 128 app = profiler.make_app(app, aggregate=False) 129 if conquer: 130 try: 131 import wsgiconq 132 except ImportError: 133 warnings.warn("Error importing wsgiconq. pyconquer will not run.") 134 else: 135 app = wsgiconq.WSGILogger(app) 129 136 if validate: 130 137 try: … … 132 139 except ImportError: 133 140 warnings.warn("Error importing wsgiref. The validator will not run.") 134 app = validate.validator(app) 141 else: 142 app = validate.validator(app) 135 143 apps.append((base, app)) 136 144 apps.sort() … … 155 163 # Tell our server about them. 156 164 sync_apps(profile=conf.get("profiling.on", False), 157 validate=conf.get("validator.on", False)) 165 validate=conf.get("validator.on", False), 166 conquer=conf.get("conquer.on", False), 167 ) 158 168 159 169 suite = CPTestLoader.loadTestsFromName(testmod) trunk/cherrypy/test/test.py
r1399 r1403 94 94 profile = False 95 95 validate = False 96 conquer = False 96 97 server = None 97 98 basedir = None … … 108 109 self.available_tests = available_tests 109 110 110 longopts = ['cover', 'profile', 'validate', ' dumb',111 longopts = ['cover', 'profile', 'validate', 'conquer', 'dumb', 111 112 '1.0', 'ssl', 'help', 112 113 'basedir=', 'port=', 'server='] … … 131 132 elif o == "--validate": 132 133 self.validate = True 134 elif o == "--conquer": 135 self.conquer = True 133 136 elif o == "--dumb": 134 137 self.interactive = False … … 167 170 print """CherryPy Test Program 168 171 Usage: 169 test.py --server=* --port=%s --1.0 --cover --basedir=path --profile --validate -- dumb --tests**172 test.py --server=* --port=%s --1.0 --cover --basedir=path --profile --validate --conquer --dumb --tests** 170 173 171 174 """ % self.__class__.port … … 187 190 --profile: turn on profiling tool 188 191 --validate: use wsgiref.validate (builtin in Python 2.5). 192 --conquer: use wsgiconq (which uses pyconquer) to trace calls. 189 193 --dumb: turn off the interactive output features. 190 194 """ % self.__class__.port … … 296 300 conf = conf or {} 297 301 conf['validator.on'] = True 302 303 if self.conquer: 304 conf = conf or {} 305 conf['conquer.on'] = True 298 306 299 307 if self.server == 'cpmodpy':

