comparison tests/test.py @ 56:2e60fb704454

add test server to the test globs
author Jeff Hammel <jhammel@mozilla.com>
date Thu, 01 Mar 2012 15:32:17 -0800
parents 143adebe4caa
children 6bfe6c59b64a
comparison
equal deleted inserted replaced
55:143adebe4caa 56:2e60fb704454
7 import doctest 7 import doctest
8 import os 8 import os
9 import shutil 9 import shutil
10 import sys 10 import sys
11 import tempfile 11 import tempfile
12 import testserver
12 import virtualenv 13 import virtualenv
13 from optparse import OptionParser 14 from optparse import OptionParser
14 15
15 def create_virtualenv(path): 16 def create_virtualenv(path):
16 """create a virtualenv and return the path to the python interpreter therein""" 17 """create a virtualenv and return the path to the python interpreter therein"""
26 # add results here 27 # add results here
27 results = {} 28 results = {}
28 29
29 # doctest arguments 30 # doctest arguments
30 directory = os.path.dirname(os.path.abspath(__file__)) 31 directory = os.path.dirname(os.path.abspath(__file__))
31 extraglobs = {'here': directory, 'create_virtualenv': create_virtualenv} 32 extraglobs = {'here': directory,
33 'create_virtualenv': create_virtualenv,
34 'server': testserver.TestWSGIserver }
32 doctest_args = dict(extraglobs=extraglobs, raise_on_error=raise_on_error) 35 doctest_args = dict(extraglobs=extraglobs, raise_on_error=raise_on_error)
33 if report_first: 36 if report_first:
34 doctest_args['optionflags'] = doctest.REPORT_ONLY_FIRST_FAILURE 37 doctest_args['optionflags'] = doctest.REPORT_ONLY_FIRST_FAILURE
35 38
36 # gather tests 39 # gather tests