From 9021194efd9fb253901c11a2a1fb83e7e8585dbf Mon Sep 17 00:00:00 2001 From: Bruno Oliveira Date: Sat, 29 Jun 2019 11:13:24 -0300 Subject: [PATCH 1/2] 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): From 94a05e513ebf7cf32ec9eaa8f0ba1930a970a8e7 Mon Sep 17 00:00:00 2001 From: Bruno Oliveira Date: Sat, 29 Jun 2019 11:19:50 -0300 Subject: [PATCH 2/2] Run py38-xdist as part of the build instead of cron --- .travis.yml | 2 -- 1 file changed, 2 deletions(-) diff --git a/.travis.yml b/.travis.yml index 2dd424e58de..8053eed65d4 100644 --- a/.travis.yml +++ b/.travis.yml @@ -55,10 +55,8 @@ jobs: - env: TOXENV=py37-pluggymaster-xdist - env: TOXENV=py37-freeze - # Jobs only run via Travis cron jobs (currently daily). - env: TOXENV=py38-xdist python: '3.8-dev' - if: type = cron - stage: baseline env: TOXENV=py36-xdist