本文整理汇总了Python中nose.run_exit函数的典型用法代码示例。如果您正苦于以下问题:Python run_exit函数的具体用法?Python run_exit怎么用?Python run_exit使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了run_exit函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: run_tests
def run_tests(self):
# Run nose ensuring that argv simulates running nosetests directly
argv = ['nosetests']
if self.test_suite != 'all':
argv.append('tests/tests.py:' + self.test_suite)
import nose
nose.run_exit(argv=argv)
示例2: main
def main(argv=None):
if argv is None:
argv = ['nosetests', '--cover-erase', '--with-coverage',
'--cover-package=fds.log_scraper']
nose.run_exit(argv=argv,
defaultTest=os.path.join(os.path.dirname(__file__), 'tests'))
示例3: unit
def unit(args, nose_run_kwargs=None):
""" Run unittests """
import os, sys
from os.path import join, dirname, abspath
test_project_module = "testproject"
sys.path.insert(0, abspath(join(dirname(__file__), test_project_module)))
sys.path.insert(0, abspath(dirname(__file__)))
os.environ['DJANGO_SETTINGS_MODULE'] = "%s.settings" % test_project_module
import nose
os.chdir(test_project_module)
argv = ["--with-django", "--with-cherrypyliveserver", "--with-selenium"] + args
nose_run_kwargs = nose_run_kwargs or {}
nose.run_exit(
argv = ["nosetests"] + argv,
defaultTest = test_project_module,
**nose_run_kwargs
)
示例4: run_tests
def run_tests(self):
# Run nose ensuring that argv simulates running nosetests directly
ret = subprocess.call([sys.executable, sys.argv[0], 'build_ext', '-i'])
if ret != 0:
raise RuntimeError("Building failed!")
import nose
nose.run_exit(argv=['nosetests'])
示例5: integrate
def integrate(args):
from citools.pavement import djangonize_test_environment
test_project_module="example_project"
args.extend(['--with-selenium', '--with-cherrypyliveserver', '--with-django', '--with-mongo-database'])
djangonize_test_environment(test_project_module)
import nose
os.chdir(join(options.rootdir, "tests", test_project_module))
from django.conf import settings
from djangosanetesting.utils import get_live_server_path, DEFAULT_URL_ROOT_SERVER_ADDRESS
settings.BUILDMASTER_NETWORK_NAME = getattr(settings, "URL_ROOT_SERVER_ADDRESS", DEFAULT_URL_ROOT_SERVER_ADDRESS)
settings.NETWORK_NAME = get_live_server_path() + "/"
nose.run_exit(
argv = ["nosetests"] + args,
defaultTest = test_project_module,
addplugins = [get_plugin()]
)
示例6: run_tests
def run_tests(self):
# Run nose ensuring that argv simulates running nosetests directly
try:
import nose
nose.run_exit(argv=['nosetests'])
except ImportError:
pass
示例7: run_all
def run_all():
logging.debug('Running tests with arguments: %r' % sys.argv)
nose.run_exit(
argv=argv,
config=CONFIG,
addplugins=extra_plugins,
)
示例8: run_tests
def run_tests(self):
# Run nose ensuring that argv simulates running nosetests directly
import nose
nose.run_exit(argv=['nosetests',
'--with-coverage',
'--cover-erase',
'--cover-branches',
'--cover-package=pbxproj',
'-w', 'tests'])
示例9: run_openmdao_suite
def run_openmdao_suite():
"""This function is exported as a script that is runnable as part of
an OpenMDAO virtual environment as openmdao_test.
This function wraps nosetests, so any valid nose args should also
work here.
"""
#Add any default packages/directories to search for tests to tlist.
tlist = ['openmdao']
break_check = ['--help', '-h', '--all']
covpkg = False # if True, --cover-package was specified by the user
# check for args not starting with '-'
args = sys.argv
for i, arg in enumerate(args):
if arg.startswith('--cover-package'):
covpkg = True
if (i>0 and not arg.startswith('-')) or arg in break_check:
break
else: # no non '-' args, so assume they want to run the whole test suite
args.append('--all')
args.append('--exe') # by default, nose will skip any .py files that are
# executable. --exe prevents this behavior
if '--with-coverage' in args:
args.append('--cover-erase')
if '--all' in args and not covpkg:
for pkg in tlist:
opt = '--cover-package=%s' % pkg
if opt not in args:
args.append(opt)
# Better coverage if we clobber cached data.
base = os.path.expanduser(os.path.join('~', '.openmdao'))
for name in ('eggsaver.dat', 'keys'):
path = os.path.join(base, name)
if os.path.exists(path):
os.remove(path)
# this tells it to enable the console in the environment so that
# the logger will print output to stdout. This helps greatly when
# debugging openmdao scripts running in separate processes.
if '--enable_console' in args:
args.remove('--enable_console')
os.environ['OPENMDAO_ENABLE_CONSOLE'] = '1'
if '--all' in args:
args.remove('--all')
args.extend(tlist)
nose.run_exit(argv=args)
示例10: start
def start(argv=None):
sys.exitfunc = lambda: sys.stderr.write("Shutting down...\n")
if argv is None:
argv = [
"nosetests", "--cover-branches", "--with-coverage",
"--cover-erase", "--verbose",
"--cover-package=django_foobar",
]
nose.run_exit(argv=argv, defaultTest=os.path.abspath(os.path.dirname(__file__)))
示例11: run_tests
def run_tests(test_project_module, nose_args, nose_run_kwargs=None):
djangonize_test_environment(test_project_module)
import nose
os.chdir(join(options.rootdir, "tests", test_project_module))
argv = ["--with-django"] + nose_args
nose_run_kwargs = nose_run_kwargs or {}
nose.run_exit(argv=["nosetests"] + argv, defaultTest=test_project_module, **nose_run_kwargs)
示例12: integrate_project
def integrate_project(args):
""" Run integration tests """
djangonize_test_environment(options.project_module)
os.chdir(join(options.rootdir, "tests"))
import nose
nose.run_exit(
argv = ["nosetests", "--with-django", "--with-selenium", "--with-djangoliveserver"]+args
)
示例13: run_all
def run_all():
argv = [
"nosetests",
"--nocapture",
"--nologcapture",
"--with-coverage",
"--cover-package=ella_attachments",
"--cover-erase",
"--with-xunit",
]
nose.run_exit(argv=argv, defaultTest=abspath(dirname(__file__)))
示例14: run_all
def run_all(argv=None):
if argv is None:
argv = [
'nosetests',
'--with-coverage', '--cover-package=ella', '--cover-erase',
'--nocapture', '--nologcapture',
'--verbose',
]
nose.run_exit(
argv=argv,
defaultTest=abspath(dirname(__file__)),
)
示例15: run_all
def run_all(args=None):
if not args:
args = [
'nosetests', '--with-xunit', '--with-xcoverage',
'--cover-package=openformats', '--cover-erase',
'--logging-filter=openformats', '--logging-level=DEBUG',
'--verbose',
]
nose.run_exit(
argv=args,
defaultTest=abspath(dirname(__file__))
)