Python 3.10: Subcomand help test fix
In Python 3.10, "Optional arguments" becomes "Options". This patch fixes that. FYI, this was reported against my Debian package: https://bugs.debian.org/1002431 and currently, the package build against Python 3.9 and 3.10, so I'm sure this patch works in both cases. Change-Id: I76dc4077dde648d1a5589b49bf697470063ca2c1
This commit is contained in:
parent
24edb142ae
commit
2284443ac9
@ -101,10 +101,14 @@ class ShellTest(utils.TestCase):
|
|||||||
matchers.MatchesRegex(r, re.DOTALL | re.MULTILINE))
|
matchers.MatchesRegex(r, re.DOTALL | re.MULTILINE))
|
||||||
|
|
||||||
def test_help_on_subcommand(self):
|
def test_help_on_subcommand(self):
|
||||||
|
if sys.version_info >= (3, 10):
|
||||||
|
options_name = 'Options'
|
||||||
|
else:
|
||||||
|
options_name = 'Optional arguments'
|
||||||
required = [
|
required = [
|
||||||
r'.*?^usage: zun create',
|
r'.*?^usage: zun create',
|
||||||
r'.*?^Create a container.',
|
r'.*?^Create a container.',
|
||||||
r'.*?^Optional arguments:',
|
r'.*?^' + options_name + ':',
|
||||||
]
|
]
|
||||||
stdout, stderr = self.shell('help create')
|
stdout, stderr = self.shell('help create')
|
||||||
for r in required:
|
for r in required:
|
||||||
|
Loading…
Reference in New Issue
Block a user