mirror of
https://github.com/borgbackup/borg.git
synced 2025-02-22 14:11:27 +00:00
Merge pull request #4001 from ThomasWaldmann/py37
argparse fix for py37, enable py37 testing
This commit is contained in:
commit
87d48d7748
3 changed files with 12 additions and 2 deletions
|
@ -20,6 +20,10 @@ matrix:
|
|||
os: linux
|
||||
dist: trusty
|
||||
env: TOXENV=py36
|
||||
- python: "3.7"
|
||||
os: linux
|
||||
dist: xenial
|
||||
env: TOXENV=py37
|
||||
- language: generic
|
||||
os: osx
|
||||
osx_image: xcode8.3
|
||||
|
|
|
@ -3669,6 +3669,12 @@ def basic_parser(self):
|
|||
|
||||
@pytest.fixture
|
||||
def subparsers(self, basic_parser):
|
||||
if sys.version_info >= (3, 7):
|
||||
# py37 pre-release defaults to unwanted required=True, in 3.7.0+ it was fixed to =False
|
||||
return basic_parser.add_subparsers(title='required arguments', metavar='<command>', required=False)
|
||||
else:
|
||||
# py36 does not support required=... argument (but behaves like required=False).
|
||||
# note: use below call for 3.6 and 3.7 when there are no alphas/betas/RCs of 3.7.0 around any more.
|
||||
return basic_parser.add_subparsers(title='required arguments', metavar='<command>')
|
||||
|
||||
@pytest.fixture
|
||||
|
|
2
tox.ini
2
tox.ini
|
@ -2,7 +2,7 @@
|
|||
# fakeroot -u tox --recreate
|
||||
|
||||
[tox]
|
||||
envlist = py{36},flake8
|
||||
envlist = py{36,37},flake8
|
||||
|
||||
[testenv]
|
||||
deps =
|
||||
|
|
Loading…
Reference in a new issue