commit: 6f194f12a2e30aad7da347848f7b0187e188f983 Author: Arthur Zamarin <arthurzam <AT> gentoo <DOT> org> AuthorDate: Wed Dec 1 17:44:23 2021 +0000 Commit: Arthur Zamarin <arthurzam <AT> gentoo <DOT> org> CommitDate: Wed Dec 1 17:47:04 2021 +0000 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=6f194f12
dev-python/argh: partial tests fix Fix two of 4 tests failures. Other two happen only on python-3.9.8 and not any later version, so will auto fix itself with time. See bug for more info. Bug: https://bugs.gentoo.org/823832 Signed-off-by: Arthur Zamarin <arthurzam <AT> gentoo.org> dev-python/argh/argh-0.26.2-r2.ebuild | 6 ++++- .../argh/files/argh-0.26.2-fix-py3.9-msgs.patch | 31 ++++++++++++++++++++++ 2 files changed, 36 insertions(+), 1 deletion(-) diff --git a/dev-python/argh/argh-0.26.2-r2.ebuild b/dev-python/argh/argh-0.26.2-r2.ebuild index 65fa34c728af..a596f642c0c6 100644 --- a/dev-python/argh/argh-0.26.2-r2.ebuild +++ b/dev-python/argh/argh-0.26.2-r2.ebuild @@ -3,7 +3,7 @@ EAPI=7 -PYTHON_COMPAT=( python3_{7..10} pypy3 ) +PYTHON_COMPAT=( python3_{8..10} pypy3 ) inherit distutils-r1 @@ -21,4 +21,8 @@ BDEPEND=" dev-python/mock[${PYTHON_USEDEP}] )" +PATCHES=( + "${FILESDIR}/${P}-fix-py3.9-msgs.patch" +) + distutils_enable_tests pytest diff --git a/dev-python/argh/files/argh-0.26.2-fix-py3.9-msgs.patch b/dev-python/argh/files/argh-0.26.2-fix-py3.9-msgs.patch new file mode 100644 index 000000000000..5835c5acbb8e --- /dev/null +++ b/dev-python/argh/files/argh-0.26.2-fix-py3.9-msgs.patch @@ -0,0 +1,31 @@ +diff --git a/test/test_integration.py b/test/test_integration.py +index 8899d8e..589f6d6 100644 +--- a/test/test_integration.py ++++ b/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' + +
