diff --git a/glanceclient/tests/functional/v1/test_readonly_glance.py b/glanceclient/tests/functional/v1/test_readonly_glance.py index a7024aaf..ffd8358d 100644 --- a/glanceclient/tests/functional/v1/test_readonly_glance.py +++ b/glanceclient/tests/functional/v1/test_readonly_glance.py @@ -51,7 +51,14 @@ class SimpleReadOnlyGlanceClientTest(base.ClientTestBase): commands = [] cmds_start = lines.index('Positional arguments:') - cmds_end = lines.index('Optional arguments:') + try: + # Starting in Python 3.10, argparse displays options in the + # "Options:" section... + cmds_end = lines.index('Options:') + except ValueError: + # ... but before Python 3.10, options were displayed in the + # "Optional arguments:" section. + cmds_end = lines.index('Optional arguments:') command_pattern = re.compile(r'^ {4}([a-z0-9\-\_]+)') for line in lines[cmds_start:cmds_end]: match = command_pattern.match(line) diff --git a/glanceclient/tests/functional/v2/test_readonly_glance.py b/glanceclient/tests/functional/v2/test_readonly_glance.py index 4d7f92d7..7bc86d18 100644 --- a/glanceclient/tests/functional/v2/test_readonly_glance.py +++ b/glanceclient/tests/functional/v2/test_readonly_glance.py @@ -71,7 +71,14 @@ class SimpleReadOnlyGlanceClientTest(base.ClientTestBase): commands = [] cmds_start = lines.index('Positional arguments:') - cmds_end = lines.index('Optional arguments:') + try: + # Starting in Python 3.10, argparse displays options in the + # "Options:" section... + cmds_end = lines.index('Options:') + except ValueError: + # ... but before Python 3.10, options were displayed in the + # "Optional arguments:" section. + cmds_end = lines.index('Optional arguments:') command_pattern = re.compile(r'^ {4}([a-z0-9\-\_]+)') for line in lines[cmds_start:cmds_end]: match = command_pattern.match(line) diff --git a/tox.ini b/tox.ini index 981ea8f2..f5160703 100644 --- a/tox.ini +++ b/tox.ini @@ -54,7 +54,9 @@ commands = [testenv:docs] basepython = python3 -deps = -r{toxinidir}/doc/requirements.txt +deps = + -r{toxinidir}/requirements.txt + -r{toxinidir}/doc/requirements.txt commands = sphinx-build -W -b html doc/source doc/build/html sphinx-build -W -b man doc/source doc/build/man