本文整理汇总了Python中nose.main方法的典型用法代码示例。如果您正苦于以下问题:Python nose.main方法的具体用法?Python nose.main怎么用?Python nose.main使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类nose
的用法示例。
在下文中一共展示了nose.main方法的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: main
# 需要导入模块: import nose [as 别名]
# 或者: from nose import main [as 别名]
def main():
args, otherargs = parse_args()
if args.no_local_import:
# Remove the current directory from the import path
exclude_sys_path('.')
remove_f('.coverage')
nose.main(
argv = [
'nosetests',
'-v',
'--with-coverage',
'--cover-inclusive',
'--cover-package=scuba',
'--detailed-errors',
'--process-timeout=60',
] + otherargs,
)
示例2: main
# 需要导入模块: import nose [as 别名]
# 或者: from nose import main [as 别名]
def main():
nose.main(addplugins=[NoseSQLAlchemy()])
示例3: setup_py_test
# 需要导入模块: import nose [as 别名]
# 或者: from nose import main [as 别名]
def setup_py_test():
"""Runner to use for the 'test_suite' entry of your setup.py.
Prevents any name clash shenanigans from the command line
argument "test" that the "setup.py test" command sends
to nose.
"""
nose.main(addplugins=[NoseSQLAlchemy()], argv=['runner'])
示例4: main
# 需要导入模块: import nose [as 别名]
# 或者: from nose import main [as 别名]
def main():
environ['DJANGO_SETTINGS_MODULE'] = 'tests.settings'
# setup path
test_dir = dirname(dirname(abspath(__file__)))
sys.path.insert(0, test_dir)
try:
# django >= 1.7
from django import setup
except ImportError:
pass
else:
setup()
# setup test env
from django.test.utils import setup_test_environment
setup_test_environment()
# setup db
from django.core.management import call_command, CommandError
options = {
'interactive': False,
'verbosity': 1,
}
try:
call_command('migrate', **options)
except CommandError: # Django < 1.7
call_command('syncdb', **options)
# run tests
return nose.main()
示例5: anyblok_nose
# 需要导入模块: import nose [as 别名]
# 或者: from nose import main [as 别名]
def anyblok_nose():
"""Run nose unit test after giving it the registry
"""
warnings.simplefilter('default')
warnings.warn(
"This script is deprecated and will be removed soon. "
"The Nose test machinery has been removed from the framework in order "
"to be replaced with Pytest. "
"If you need to run your tests with nose, install the Nose package.",
DeprecationWarning, stacklevel=2)
try:
from nose import main
except ImportError:
logger.error('"Nosetest" is not installed, try: pip install nose')
registry = anyblok.start('nose', useseparator=True, unittest=True)
if registry:
installed_bloks = registry.System.Blok.list_by_state("installed")
selected_bloks = return_list(
Configuration.get('selected_bloks')) or installed_bloks
unwanted_bloks = return_list(
Configuration.get('unwanted_bloks')) or []
unwanted_bloks.extend(['anyblok-core', 'anyblok-test', 'model_authz'])
defaultTest = []
for blok in installed_bloks:
if blok not in selected_bloks or blok in unwanted_bloks:
continue
startpath = BlokManager.getPath(blok)
for root, dirs, _ in walk(startpath):
if 'tests' in dirs:
defaultTest.append(join(root, 'tests'))
registry.close() # free the registry to force create it again
sys.exit(main(defaultTest=defaultTest))
示例6: run_tests
# 需要导入模块: import nose [as 别名]
# 或者: from nose import main [as 别名]
def run_tests(self):
import nose
sys.exit(nose.main(argv=self.argv))
示例7: run
# 需要导入模块: import nose [as 别名]
# 或者: from nose import main [as 别名]
def run():
os.environ["NOSE_WITH_COVERAGE"] = "1"
os.environ['NOSE_COVER_PACKAGE'] = 'emva1288'
os.environ["NOSE_COVER_HTML"] = "1"
os.environ["NOSE_COVER_ERASE"] = "1"
nose.main(defaultTest=default_test_modules)
示例8: setup_py_test
# 需要导入模块: import nose [as 别名]
# 或者: from nose import main [as 别名]
def setup_py_test():
"""Runner to use for the 'test_suite' entry of your setup.py.
Prevents any name clash shenanigans from the command line
argument "tests" that the "setup.py tests" command sends
to nose.
"""
nose.main(addplugins=[NoseSQLAlchemy()], argv=['runner'])
示例9: run
# 需要导入模块: import nose [as 别名]
# 或者: from nose import main [as 别名]
def run(self, parser, args):
import nose
sys.argv = [sys.argv[0]] + args.nose_args
if 'RELENGAPI_SETTINGS' in os.environ:
del os.environ['RELENGAPI_SETTINGS']
# enable sqlalchemy logging
logging.getLogger('sqlalchemy.engine').setLevel(logging.INFO)
# push a fake app context to avoid tests accidentally using the
# runtime app context (for example, the development DB)
with Flask(__name__).app_context():
nose.main(addplugins=[ResetLogging()])
示例10: main
# 需要导入模块: import nose [as 别名]
# 或者: from nose import main [as 别名]
def main():
nose.main()