forked from pool/python-argh
* Deal with Python 3.9.x changes in argparse. OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-argh?expand=0&rev=27
32 lines
1.1 KiB
Diff
32 lines
1.1 KiB
Diff
Index: argh-0.26.2/test/test_integration.py
|
|
===================================================================
|
|
--- argh-0.26.2.orig/test/test_integration.py
|
|
+++ argh-0.26.2/test/test_integration.py
|
|
@@ -377,7 +377,7 @@ def test_invalid_choice():
|
|
p = DebugArghParser()
|
|
p.add_commands([cmd])
|
|
|
|
- assert run(p, 'bar', exit=True).startswith('invalid choice')
|
|
+ assert 'invalid choice' in run(p, 'bar', exit=True)
|
|
|
|
if sys.version_info < (3,3):
|
|
# Python before 3.3 exits with a less informative error
|
|
@@ -391,7 +391,7 @@ def test_invalid_choice():
|
|
p = DebugArghParser()
|
|
p.add_commands([cmd], namespace='nest')
|
|
|
|
- assert run(p, 'nest bar', exit=True).startswith('invalid choice')
|
|
+ assert 'invalid choice' in run(p, 'nest bar', exit=True)
|
|
|
|
if sys.version_info < (3,3):
|
|
# Python before 3.3 exits with a less informative error
|
|
@@ -511,7 +511,7 @@ def test_explicit_cmd_name():
|
|
|
|
p = DebugArghParser()
|
|
p.add_commands([orig_name])
|
|
- assert run(p, 'orig-name', exit=True).startswith('invalid choice')
|
|
+ assert 'invalid choice' in run(p, 'orig-name', exit=True)
|
|
assert run(p, 'new-name').out == 'ok\n'
|
|
|
|
|