本文整理汇总了Python中setup.print_failure_message函数的典型用法代码示例。如果您正苦于以下问题:Python print_failure_message函数的具体用法?Python print_failure_message怎么用?Python print_failure_message使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了print_failure_message函数的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: print_failed
def print_failed():
# generated on http://patorjk.com/software/taag/#p=display&f=Small&t=FAILED
print_failure_message(r''' ___ _ ___ _ ___ ___
| __/_\ |_ _| | | __| \
| _/ _ \ | || |__| _|| |) |
|_/_/ \_\___|____|___|___/
''')
示例2: coverage
def coverage():
"""Run tests and show test coverage report."""
try:
import pytest_cov # NOQA
except ImportError:
print_failure_message("Install the pytest coverage plugin to use this task, " "i.e., `pip install pytest-cov'.")
raise SystemExit(1)
import pytest
pytest.main(PYTEST_FLAGS + ["--cov", CODE_DIRECTORY, "--cov-report", "term-missing", TESTS_DIRECTORY])
示例3: on_modified
def on_modified(self, event):
print_failure_message('Modification detected. Rebuilding docs.')
# # Strip off the path prefix.
# import os
# if event.src_path[len(os.getcwd()) + 1:].startswith(
# CODE_DIRECTORY):
# # sphinx-build doesn't always pick up changes on code files,
# # even though they are used to generate the documentation. As
# # a workaround, just clean before building.
doc_html()
print_success_message('Docs have been rebuilt.')
示例4: doc_open
def doc_open():
"""Build the HTML docs and open them in a web browser."""
doc_index = os.path.join(DOCS_DIRECTORY, "build", "html", "index.html")
if sys.platform == "darwin":
# Mac OS X
subprocess.check_call(["open", doc_index])
elif sys.platform == "win32":
# Windows
subprocess.check_call(["start", doc_index], shell=True)
elif sys.platform == "linux2":
# All freedesktop-compatible desktops
subprocess.check_call(["xdg-open", doc_index])
else:
print_failure_message("Unsupported platform. Please open `{0}' manually.".format(doc_index))
示例5: coverage
def coverage():
"""Run tests and show test coverage report."""
try:
import pytest_cov # NOQA
except ImportError:
print_failure_message(
'Install the pytest coverage plugin to use this task, '
"i.e., `pip install pytest-cov'.")
raise SystemExit(1)
import pytest
pytest.main(PYTEST_FLAGS + [
'--cov', CODE_DIRECTORY,
'--cov-report', 'term-missing',
'--junit-xml', 'test-report.xml',
TESTS_DIRECTORY])
示例6: doc_open
def doc_open():
"""Build the HTML docs and open them in a web browser."""
doc_index = os.path.join(DOCS_DIRECTORY, 'build', 'html', 'index.html')
if sys.platform == 'darwin':
# Mac OS X
subprocess.check_call(['open', doc_index])
elif sys.platform == 'win32':
# Windows
subprocess.check_call(['start', doc_index], shell=True)
elif sys.platform == 'linux2':
# All freedesktop-compatible desktops
subprocess.check_call(['xdg-open', doc_index])
else:
print_failure_message(
"Unsupported platform. Please open `{0}' manually.".format(
doc_index))
示例7: commit
def commit():
"""Commit only if all the tests pass."""
if _test_all() == 0:
subprocess.check_call(['git', 'commit'])
else:
print_failure_message('\nTests failed, not committing.')
示例8: cov
def cov():
""" Get test coverage """
retcode = subprocess.call(
'py.test --cov-report term-missing --cov pyres', shell=True)
if retcode != 0:
print_failure_message('Failed running pytest')