本文整理汇总了Python中tox.cmdline函数的典型用法代码示例。如果您正苦于以下问题:Python cmdline函数的具体用法?Python cmdline怎么用?Python cmdline使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了cmdline函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: main
def main(args=None):
global base
args = parser.parse_args(args)
base = os.getcwd()
if args.dir:
base = args.dir
if args.command[0] == "sanity":
auditfiles()
auditsetup()
elif args.command[0] == "style":
auditstyle()
elif args.command[0] == "test":
nose()
elif args.command[0] == "test-all":
import tox
tox.cmdline(("-c", os.path.join(base, "tox.ini")))
elif args.command[0] == "publish":
printer.info("Going to run sanity checks and tests first")
auditfiles()
packagename, packageversion = auditsetup()
auditstyle()
nose()
publish(packagename, packageversion)
exit(0)
示例2: run
def run(self):
try:
import tox
except ImportError:
import sys
sys.exit("tox is required to run tests. $ pip install tox")
tox.cmdline()
示例3: main
def main(argv):
if len(argv) == 1:
print('Usage: {0} GEN_PATH [TOX_ARGS...]', file=sys.stderr)
# Get the project root directory.
project_root = os.path.dirname(os.path.dirname(
os.path.realpath(__file__)))
temp_dir = argv[1]
print('Copying files to ', temp_dir)
shutil.copytree(project_root, temp_dir)
os.chdir(temp_dir)
# Run generation.
sys.path.insert(0, os.path.realpath('internal'))
import generate
generate.main()
# Run tox.
import tox
# tox will raise SystemExit() and try to exit. We don't want that.
try:
tox.cmdline(argv[2:])
except SystemExit:
pass
# Print out the directory name for the shell script.
print(temp_dir)
示例4: run_tests
def run_tests(self):
import tox
import shlex
if self.tox_args:
errno = tox.cmdline(args=shlex.split(self.tox_args))
else:
errno = tox.cmdline(self.test_args)
sys.exit(errno)
示例5: run_tests
def run_tests(self):
#import here, cause outside the eggs aren't loaded
import tox
import shlex
args = self.tox_args
if args:
args = shlex.split(self.tox_args)
tox.cmdline(args=args)
示例6: run_tests
def run_tests(self):
# Import here, cause outside the eggs aren't loaded
import tox # pylint: disable=import-error
import shlex
args = self.tox_args
if args:
args = shlex.split(self.tox_args)
tox.cmdline(args=args)
示例7: run_tests
def run_tests(self):
import tox
args = self.tox_args
if args:
args = split(self.tox_args)
errno = tox.cmdline(args=args)
exit(errno)
示例8: run_tests
def run_tests(self):
import tox
if self.environment:
self.test_args.append('-e{0}'.format(self.environment))
errno = tox.cmdline(self.test_args)
sys.exit(errno)
示例9: _run_tox
def _run_tox(self):
self.distribution.fetch_build_eggs(self.requirements_tox)
import tox
exit_code = tox.cmdline(args=self.additional_test_args)
raise SystemExit(exit_code)
示例10: run_tests
def run_tests(self):
from tox import cmdline
args = self.tox_args
if args:
args = split(self.tox_args)
errno = cmdline(args=args)
exit(errno)
示例11: run_tests
def run_tests(self):
# Import here because outside the eggs aren't loaded.
import tox
import shlex
errno = tox.cmdline(args=shlex.split(self.tox_args))
sys.exit(errno)
示例12: run_tests
def run_tests(self):
"""Invoke the test runner (tox)."""
# import here, cause outside the eggs aren't loaded
import tox
import shlex
errno = tox.cmdline(args=shlex.split(self.tox_args))
sys.exit(errno)
示例13: run_tests
def run_tests(self):
#import here, cause outside the eggs aren't loaded
import tox
if self.environment:
self.test_args.append('-e{0}'.format(self.environment))
errno = tox.cmdline(self.test_args)
sys.exit(errno)
示例14: run_tests
def run_tests(self):
#import here, cause outside the eggs aren't loaded
import tox
import os
del os.environ["PYTHONPATH"]
errcode = tox.cmdline(self.test_args)
sys.exit(errcode)
示例15: runtox
def runtox(self, link):
# publishing some infos to the commands started by tox
#setenv_devpi(self.hub, env, posturl=self.current.resultlog,
# packageurl=link.url,
# packagemd5=link.md5)
jsonreport = link.pkg.rootdir.join("toxreport.json")
path_archive = link.pkg.path_archive
toxargs = ["--installpkg", str(path_archive),
"-i ALL=%s" % str(self.current.simpleindex),
"--result-json", str(jsonreport),
]
unpack_path = link.pkg.path_unpacked
toxargs.extend(self.get_tox_args(unpack_path=unpack_path))
with link.pkg.path_unpacked.as_cwd():
self.hub.info("%s$ tox %s" %(os.getcwd(), " ".join(toxargs)))
try:
ret = tox.cmdline(toxargs)
except SystemExit as e:
ret = e.args[0]
if ret != 2:
jsondata = json.load(jsonreport.open("r"))
url = URL(link.url)
post_tox_json_report(self.hub, url.url_nofrag, jsondata)
if ret != 0:
self.hub.error("tox command failed", ret)
return 1
return 0