diff options
author | Daniel Hahler <git@thequod.de> | 2020-02-28 19:41:56 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-02-28 19:41:56 +0100 |
commit | 5819536f00ace91660c95ef7d65ff1c425a7b5b8 (patch) | |
tree | add5924091652e78dffd5c8a72edab3f0fe6386f /testing/test_config.py | |
parent | 952cab2d85416667cd016205ba304db70594b057 (diff) | |
download | pytest-5819536f00ace91660c95ef7d65ff1c425a7b5b8.tar.gz |
Improve UsageError with invalid `-o` style (#6795)
This started from fixing the test, where `"xdist_strict True"` was used
as a single argument, although you typically would see `["xdist_strict",
"True"]`.
Improves the error message to mention the option that caused the error.
Diffstat (limited to 'testing/test_config.py')
-rw-r--r-- | testing/test_config.py | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/testing/test_config.py b/testing/test_config.py index c446a4141..be728c0fc 100644 --- a/testing/test_config.py +++ b/testing/test_config.py @@ -1089,8 +1089,12 @@ class TestOverrideIniArgs: xdist_strict=False """ ) - result = testdir.runpytest("--override-ini", "xdist_strict True", "-s") - result.stderr.fnmatch_lines(["*ERROR* *expects option=value*"]) + result = testdir.runpytest("--override-ini", "xdist_strict", "True") + result.stderr.fnmatch_lines( + [ + "ERROR: -o/--override-ini expects option=value style (got: 'xdist_strict').", + ] + ) @pytest.mark.parametrize("with_ini", [True, False]) def test_override_ini_handled_asap(self, testdir, with_ini): |