Merge pull request #3921 from nicoddemus/use-constant

Use EXIT_USAGEERROR instead of magic number
This commit is contained in:
Bruno Oliveira 2018-09-01 20:09:39 -03:00 committed by GitHub
commit dfa713163a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
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