commit:     9f1189dc4804dbf393be7c5315db35aa979b7625
Author:     Michał Górny <mgorny <AT> gentoo <DOT> org>
AuthorDate: Sat May 31 10:23:40 2025 +0000
Commit:     Arthur Zamarin <arthurzam <AT> gentoo <DOT> org>
CommitDate: Sat May 31 10:26:35 2025 +0000
URL:        
https://gitweb.gentoo.org/proj/pkgcore/snakeoil.git/commit/?id=9f1189dc

tests: Loosen the argparse exception check

Loosen the argparse exception check to fix tests with Python 3.14.
Starting with Python 3.14, the exception is supposed to use single
quotes rather than double quotes.  However, due to
https://github.com/python/cpython/pull/134971 it currently does not
include the name at all -- an easy way to get compatibility for both
quoting variants and to work around the bug is to not check the name
at all.

Signed-off-by: Michał Górny <mgorny <AT> gentoo.org>
Part-of: https://github.com/pkgcore/snakeoil/pull/105
Closes: https://github.com/pkgcore/snakeoil/pull/105
Signed-off-by: Arthur Zamarin <arthurzam <AT> gentoo.org>

 tests/cli/test_arghparse.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tests/cli/test_arghparse.py b/tests/cli/test_arghparse.py
index c55e786..84ff6dd 100644
--- a/tests/cli/test_arghparse.py
+++ b/tests/cli/test_arghparse.py
@@ -139,7 +139,7 @@ class TestCsvActionsParser:
     def test_bad_action(self):
         with pytest.raises(ValueError) as excinfo:
             self.csv_parser.add_argument("--arg1", action="unknown")
-        assert 'unknown action "unknown"' == str(excinfo.value)
+        assert "unknown action" in str(excinfo.value)
 
     def test_csv_actions(self):
         self.csv_parser.add_argument("--arg1", action="csv")

Reply via email to