本文整理汇总了Python中setuptools.command.test.test.run函数的典型用法代码示例。如果您正苦于以下问题:Python run函数的具体用法?Python run怎么用?Python run使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了run函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: run
def run(self):
# Evita que as dependências sejam instaladas em um diretório ".egg/"
# durante os testes, o que é útil se você estiver depurando usando
# virtualenv e quer que sejam utilizadas as dependências já disponíveis
# no ambiente virtual.
self.distribution.install_requires = []
TestCommand.run(self)
示例2: run
def run(self):
entry_points = os.path.join('distribute.egg-info', 'entry_points.txt')
if not os.path.exists(entry_points):
try:
_test.run(self)
finally:
return
f = open(entry_points)
# running the test
try:
ep_content = f.read()
finally:
f.close()
try:
_test.run(self)
finally:
# restoring the file
f = open(entry_points, 'w')
try:
f.write(ep_content)
finally:
f.close()
示例3: run
def run(self):
test.run(self)
import nose
import logging
logging.disable(logging.CRITICAL)
nose.main(argv=['tests', '-v'])
示例4: run
def run(self):
test.run(self)
import pytest
cov = ''
if self.pytest_cov is not None:
outputs = ' '.join('--cov-report %s' % output
for output in self.pytest_cov.split(','))
cov = ' --cov openhtf ' + outputs
sys.exit(pytest.main(self.pytest_args + cov))
示例5: run
def run(self):
# Call this to do complicated distribute stuff.
original_test.run(self)
for cmd in ['nosetests']:
try:
self.run_command(cmd)
except SystemExit, e:
if e.code:
raise
示例6: run
def run(self):
if options.cpptests:
optimize = "Dbg"
comp_cmd = ["scons", "--optimize={0}".format(optimize), "--target=Tests", "-j{0}".format(jobs)]
print("initializing NetworKit compilation with: {0}".format(" ".join(comp_cmd)))
if not subprocess.call(comp_cmd) == 0:
print("scons returned an error, exiting setup.py")
exit(1)
run_cpp_cmd = ["./NetworKit-Tests-{0}".format(optimize),"-t"]
if subprocess.call(run_cpp_cmd) == 0:
print("C++ unit tests didn't report any errors")
else:
print("some C++ unit tests failed, see above")
TestCommand.run(self)
示例7: run
def run(self):
if self.verbosity > 0:
# ensure that deprecation warnings are displayed during testing
# the following state is assumed:
# logging.capturewarnings is true
# a "default" level warnings filter has been added for
# DeprecationWarning. See django.conf.LazySettings._configure_logging
logger = logging.getLogger('py.warnings')
handler = logging.StreamHandler()
logger.addHandler(handler)
TestCommand.run(self)
if self.verbosity > 0:
# remove the testing-specific handler
logger.removeHandler(handler)
示例8: run
def run(self):
if sys.platform == 'darwin':
# Docker for Mac exports certain paths into the virtual machine
# actually running Docker. The default tempdir isn't one of them,
# but /tmp is.
os.environ['TMPDIR'] = '/tmp'
return TestCommand.run(self)
示例9: run
def run(self):
entry_points = os.path.join('setuptools.egg-info', 'entry_points.txt')
if not os.path.exists(entry_points):
_test.run(self)
return # even though _test.run will raise SystemExit
# save the content
with open(entry_points) as f:
ep_content = f.read()
# run the test
try:
_test.run(self)
finally:
# restore the file
with open(entry_points, 'w') as f:
f.write(ep_content)
示例10: run
def run(self):
# Install dependencies
if self.distribution.install_requires:
self.distribution.fetch_build_eggs(
self.distribution.install_requires)
if self.distribution.tests_require:
self.distribution.fetch_build_eggs(self.distribution.tests_require)
# Use the flake8 setup.py command (declared via entry_points in flake8's setup.py)
self.run_command("flake8")
# Run the unittests as normal
return test_cmd.run(self) # Can't use super() since test_cmd is an old-style class...
示例11: run
def run(self):
# Make sure all modules are ready
build_cmd = self.get_finalized_command("build_py")
build_cmd.run()
# And make sure our scripts are ready
build_scripts_cmd = self.get_finalized_command("build_scripts")
build_scripts_cmd.run()
# make symlinks for test data
if build_cmd.build_lib != top_dir:
for path in ['testfiles.tar.gz', 'gnupg']:
src = os.path.join(top_dir, 'testing', path)
target = os.path.join(build_cmd.build_lib, 'testing', path)
try:
os.symlink(src, target)
except Exception:
pass
os.environ['PATH'] = "%s:%s" % (
os.path.abspath(build_scripts_cmd.build_dir),
os.environ.get('PATH'))
test.run(self)
示例12: run
def run(self):
entry_points = os.path.join('setuptools.egg-info', 'entry_points.txt')
if not os.path.exists(entry_points):
_test.run(self)
return # even though _test.run will raise SystemExit
f = open(entry_points)
# running the test
try:
ep_content = f.read()
finally:
f.close()
try:
_test.run(self)
finally:
# restoring the file
f = open(entry_points, 'w')
try:
f.write(ep_content)
finally:
f.close()
示例13: run
def run(self, *args, **kwargs):
for env_name, env_value in self.extra_env.items():
os.environ[env_name] = str(env_value)
TestCommand.run(self, *args, **kwargs)
示例14: run
def run(self):
test.run(self)
self.with_project_on_sys_path(self.run_benchmark)
示例15: run
def run(self):
self.pep8_report()
TestCommand.run(self)