Download Install Tutorial Docs FAQ Tools WikiLicense Team IRC Planet Involvement Shop Book

Changeset 1403

Show
Ignore:
Timestamp:
10/20/06 13:46:12
Author:
fumanchu
Message:

Support for wsgiconq in test suite (use --conquer arg).

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/cherrypy/test/helper.py

    r1392 r1403  
    120120        return 1 
    121121 
    122 def sync_apps(profile=False, validate=False): 
     122def sync_apps(profile=False, validate=False, conquer=False): 
    123123    apps = [] 
    124124    for base, app in cherrypy.tree.apps.iteritems(): 
     
    127127        if profile: 
    128128            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) 
    129136        if validate: 
    130137            try: 
     
    132139            except ImportError: 
    133140                warnings.warn("Error importing wsgiref. The validator will not run.") 
    134             app = validate.validator(app) 
     141            else: 
     142                app = validate.validator(app) 
    135143        apps.append((base, app)) 
    136144    apps.sort() 
     
    155163        # Tell our server about them. 
    156164        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                  ) 
    158168         
    159169        suite = CPTestLoader.loadTestsFromName(testmod) 
  • trunk/cherrypy/test/test.py

    r1399 r1403  
    9494    profile = False 
    9595    validate = False 
     96    conquer = False 
    9697    server = None 
    9798    basedir = None 
     
    108109        self.available_tests = available_tests 
    109110         
    110         longopts = ['cover', 'profile', 'validate', 'dumb', 
     111        longopts = ['cover', 'profile', 'validate', 'conquer', 'dumb', 
    111112                    '1.0', 'ssl', 'help', 
    112113                    'basedir=', 'port=', 'server='] 
     
    131132            elif o == "--validate": 
    132133                self.validate = True 
     134            elif o == "--conquer": 
     135                self.conquer = True 
    133136            elif o == "--dumb": 
    134137                self.interactive = False 
     
    167170        print """CherryPy Test Program 
    168171    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** 
    170173         
    171174    """ % self.__class__.port 
     
    187190    --profile: turn on profiling tool 
    188191    --validate: use wsgiref.validate (builtin in Python 2.5). 
     192    --conquer: use wsgiconq (which uses pyconquer) to trace calls. 
    189193    --dumb: turn off the interactive output features. 
    190194    """ % self.__class__.port 
     
    296300            conf = conf or {} 
    297301            conf['validator.on'] = True 
     302         
     303        if self.conquer: 
     304            conf = conf or {} 
     305            conf['conquer.on'] = True 
    298306         
    299307        if self.server == 'cpmodpy': 

Hosted by WebFaction

Log in as guest/cpguest to create tickets