From 8af265da040494db9fbc8ea551c19d435ab2266c Mon Sep 17 00:00:00 2001 From: Marc Abramowitz Date: Wed, 26 Mar 2014 10:47:30 -0700 Subject: [PATCH] _pytest/config.py: In --help, show args with `=` instead of space. The `=` is better because it encourages folks to use the form that doesn't suffer from issue #436 (https://bitbucket.org/hpk42/pytest/issue/436), which can cause the arg to be treated as an "anchor" and used as the (unexpected) path for searching for conftest.py files. --HG-- branch : help_show_args_with_equals_instead_of_space --- _pytest/config.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/_pytest/config.py b/_pytest/config.py index c22716bb3..397cb6fa7 100644 --- a/_pytest/config.py +++ b/_pytest/config.py @@ -436,7 +436,7 @@ class DropShorterLongHelpFormatter(py.std.argparse.HelpFormatter): if len(option) == 2 or option[2] == ' ': return_list.append(option) if option[2:] == short_long.get(option.replace('-', '')): - return_list.append(option) + return_list.append(option.replace(' ', '=')) action._formatted_action_invocation = ', '.join(return_list) return action._formatted_action_invocation