15
0
forked from pool/python-argh

Accepting request 920718 from devel:languages:python

- Add patch support-py39.patch:
  * Deal with Python 3.9.x changes in argparse.

OBS-URL: https://build.opensuse.org/request/show/920718
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/python-argh?expand=0&rev=17
This commit is contained in:
2021-09-22 20:12:52 +00:00
committed by Git OBS Bridge
3 changed files with 39 additions and 1 deletions

View File

@@ -1,3 +1,9 @@
-------------------------------------------------------------------
Wed Sep 22 04:41:45 UTC 2021 - Steve Kowalik <steven.kowalik@suse.com>
- Add patch support-py39.patch:
* Deal with Python 3.9.x changes in argparse.
-------------------------------------------------------------------
Mon May 17 11:16:59 UTC 2021 - pgajdos@suse.com

View File

@@ -22,9 +22,9 @@ Version: 0.26.2
Release: 0
Summary: An argparse wrapper
License: LGPL-3.0-or-later
Group: Development/Languages/Python
URL: https://github.com/neithere/argh/
Source: https://files.pythonhosted.org/packages/source/a/argh/argh-%{version}.tar.gz
Patch0: support-py39.patch
BuildRequires: %{python_module iocapture}
BuildRequires: %{python_module mock}
BuildRequires: %{python_module pytest}
@@ -56,6 +56,7 @@ work that a custom dispatcher may not do.
%prep
%setup -q -n argh-%{version}
%autopatch -p1
%build
%python_build

31
support-py39.patch Normal file
View File

@@ -0,0 +1,31 @@
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'