From 90c00dfd542a5d95b0534502ccc2fe72e8909ed7 Mon Sep 17 00:00:00 2001 From: Bruno Oliveira Date: Sat, 1 Sep 2018 12:03:28 -0300 Subject: [PATCH] Use EXIT_USAGEERROR instead of magic number --- src/_pytest/config/__init__.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/_pytest/config/__init__.py b/src/_pytest/config/__init__.py index 921b3ef20..9399abb1d 100644 --- a/src/_pytest/config/__init__.py +++ b/src/_pytest/config/__init__.py @@ -51,6 +51,8 @@ def main(args=None, plugins=None): :arg plugins: list of plugin objects to be auto-registered during initialization. """ + from _pytest.main import EXIT_USAGEERROR + try: try: config = _prepareconfig(args, plugins) @@ -69,7 +71,7 @@ def main(args=None, plugins=None): tw = py.io.TerminalWriter(sys.stderr) for msg in e.args: tw.line("ERROR: {}\n".format(msg), red=True) - return 4 + return EXIT_USAGEERROR class cmdline(object): # compatibility namespace