Python nose 模块,run_exit() 实例源码
我们从Python开源项目中,提取了以下11个代码示例,用于说明如何使用nose.run_exit()。
def run_tests(self):
# Run nose ensuring that argv simulates running nosetests directly
import nose
nose.run_exit(argv=['nosetests'])
def run_all(argv=None):
sys.exitfunc = lambda: sys.stderr.write('Shutting down....\n')
# always insert coverage when running tests through setup.py
if argv is None:
argv = [
'nosetests', '--with-xunit',
'--logging-format=%(levelname)s %(name)22s %(funcName)22s:%(lineno)-4d %(message)s',
'--with-xcoverage', '--cover-package=kibtool', '--cover-erase',
'--verbose',
]
nose.run_exit(
argv=argv,
defaultTest=abspath(dirname(__file__))
)
def run_all(argv=None):
if argv is None:
argv = [
'nosetests',
'--with-xcoverage', '--cover-package=populator',
'--logging-filter=mongo-populator', '--logging-level=DEBUG',
'--verbose',
]
os.environ['MONGO_POPULATOR_CONFIG'] = os.path.join(
os.path.dirname(__file__), 'mongo-populator.cfg'
)
nose.run_exit(
argv=argv,
defaultTest=os.path.abspath(os.path.dirname(__file__))
)
del os.environ['MONGO_POPULATOR_CONFIG']
def run_tests(self):
# Run nose ensuring that argv simulates running nosetests directly
import nose
nose.run_exit(argv=['nosetests'])
def start(argv=None):
sys.exitfunc = lambda: sys.stderr.write('Shutting down...\n')
if argv is None:
argv = [
'nosetests',
'--with-coverage',
'--cover-html', '--cover-html-dir=.htmlcov',
'--cover-erase',
'--cover-branches',
'--cover-package=chemtrails',
]
nose.run_exit(argv=argv, defaultTest=os.path.abspath(os.path.dirname(__file__)))
def start(argv=None):
sys.exitfunc = lambda: sys.stderr.write('Shutting down...\n')
if argv is None:
argv = [
'nosetests',
'--cover-package=hesab', defaultTest=os.path.abspath(os.path.dirname(__file__)))
def run_all(argv=None):
sys.exitfunc = lambda: sys.stderr.write('Shutting down....\n')
# always insert coverage when running tests through setup.py
if argv is None:
argv = [
'nosetests', '--with-coverage', '--cover-package=haystack_elasticsearch', '--verbose',
]
nose.run_exit(
argv=argv,
defaultTest=abspath(dirname(__file__))
)
def run_tests(self):
# Run the nose ensuring that argv simulates running nosetests directly
import nose
nose.run_exit(argv=['nosetests'])
def main(argv=None):
if argv is None:
argv = ["nosetests"]
path = os.path.abspath(os.path.dirname(__file__))
nose.run_exit(argv=argv, defaultTest=path)
def run_tests(self):
# Run nose ensuring that argv simulates running nosetests directly
import nose
nose.run_exit(argv=['nosetests'])
def run_all(argv=None):
sys.exitfunc = lambda: sys.stderr.write("Shutting down....\n")
if argv is None:
argv = [
"nosetests", "--with-xunit",
"--with-xcoverage", "--cover-package=affectv_python",
"--cover-erase", "--verbose"
]
environ["AFFECTV_COUNTER_KEY"] = "affectv_test:counter"
nose.run_exit(argv=argv, defaultTest=abspath(dirname(__file__)))
del environ["AFFECTV_COUNTER_KEY"]
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 [email protected] 举报,一经查实,本站将立刻删除。