From 330b71afeb91019c0bfb8335d919447609942f77 Mon Sep 17 00:00:00 2001 From: Bruno Oliveira Date: Sat, 29 Jun 2019 11:13:24 -0300 Subject: [PATCH] Apply workaround for multiple short options for Python <= 3.8 Hopefully by Python 3.9 this will be fixed upstream, if not we will need to bump the version again. Fix #5523 --- changelog/5523.bugfix.rst | 1 + src/_pytest/config/argparsing.py | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) create mode 100644 changelog/5523.bugfix.rst diff --git a/changelog/5523.bugfix.rst b/changelog/5523.bugfix.rst new file mode 100644 index 00000000000..5155b92b156 --- /dev/null +++ b/changelog/5523.bugfix.rst @@ -0,0 +1 @@ +Fixed using multiple short options together in the command-line (for example ``-vs``) in Python 3.8+. diff --git a/src/_pytest/config/argparsing.py b/src/_pytest/config/argparsing.py index d62ed0d03c2..43cf62ab167 100644 --- a/src/_pytest/config/argparsing.py +++ b/src/_pytest/config/argparsing.py @@ -358,7 +358,7 @@ def parse_args(self, args=None, namespace=None): getattr(args, FILE_OR_DIR).extend(argv) return args - if sys.version_info[:2] < (3, 8): # pragma: no cover + if sys.version_info[:2] < (3, 9): # pragma: no cover # Backport of https://github.com/python/cpython/pull/14316 so we can # disable long --argument abbreviations without breaking short flags. def _parse_optional(self, arg_string):