Use EXIT_USAGEERROR instead of magic number

This commit is contained in:
Bruno Oliveira 2018-09-01 12:03:28 -03:00
parent 495b44198f
commit 90c00dfd54
1 changed files with 3 additions and 1 deletions

View File

@ -51,6 +51,8 @@ def main(args=None, plugins=None):
:arg plugins: list of plugin objects to be auto-registered during :arg plugins: list of plugin objects to be auto-registered during
initialization. initialization.
""" """
from _pytest.main import EXIT_USAGEERROR
try: try:
try: try:
config = _prepareconfig(args, plugins) config = _prepareconfig(args, plugins)
@ -69,7 +71,7 @@ def main(args=None, plugins=None):
tw = py.io.TerminalWriter(sys.stderr) tw = py.io.TerminalWriter(sys.stderr)
for msg in e.args: for msg in e.args:
tw.line("ERROR: {}\n".format(msg), red=True) tw.line("ERROR: {}\n".format(msg), red=True)
return 4 return EXIT_USAGEERROR
class cmdline(object): # compatibility namespace class cmdline(object): # compatibility namespace