diff --git a/0002-Fix-test-error.patch b/0002-Fix-test-error.patch new file mode 100644 index 0000000000000000000000000000000000000000..6d16a42bcbfd5a3b58c17954f1f0051432919bcb --- /dev/null +++ b/0002-Fix-test-error.patch @@ -0,0 +1,84 @@ +diff --git a/testtools/tests/test_run.py b/testtools/tests/test_run.py +index ee96eec..9808421 100644 +--- a/testtools/tests/test_run.py ++++ b/testtools/tests/test_run.py +@@ -202,9 +202,9 @@ unittest.loader._FailedTest.runexample + Failed to import test module: runexample + Traceback (most recent call last): + File ".../loader.py", line ..., in _find_test_path +- package = self._get_module_from_name(name) ++ package = self._get_module_from_name(name)... + File ".../loader.py", line ..., in _get_module_from_name +- __import__(name) ++ __import__(name)... + File ".../runexample/__init__.py", line 1 + class not in + ...^... +diff --git a/testtools/tests/test_testresult.py b/testtools/tests/test_testresult.py +index a9db0e2..748a926 100644 +--- a/testtools/tests/test_testresult.py ++++ b/testtools/tests/test_testresult.py +@@ -1266,11 +1266,11 @@ class TestTestResult(TestCase): + DocTestMatches( + 'Traceback (most recent call last):\n' + ' File "...testtools...runtest.py", line ..., in _run_user\n' +- ' return fn(*args, **kwargs)\n' ++ ' return fn(*args, **kwargs)\n...' + ' File "...testtools...testcase.py", line ..., in _run_test_method\n' +- ' return self._get_test_method()()\n' ++ ' return self._get_test_method()()\n...' + ' File "...testtools...tests...test_testresult.py", line ..., in error\n' +- ' 1/0\n' ++ ' 1/0\n...' + 'ZeroDivisionError: ...\n', + doctest.ELLIPSIS | doctest.REPORT_UDIFF)) + +@@ -1283,7 +1283,7 @@ class TestTestResult(TestCase): + DocTestMatches( + 'Traceback (most recent call last):\n' + ' File "...testtools...tests...test_testresult.py", line ..., in error\n' +- ' 1/0\n' ++ ' 1/0\n...' + 'ZeroDivisionError: ...\n', + doctest.ELLIPSIS)) + +@@ -1322,17 +1322,17 @@ class TestTestResult(TestCase): + DocTestMatches( + 'Traceback (most recent call last):\n' + ' File "...testtools...runtest.py", line ..., in _run_user\n' +- ' return fn(*args, **kwargs)\n' ++ ' return fn(*args, **kwargs)\n...' + ' args = ...\n' + ' fn = ...\n' + ' kwargs = ...\n' + ' self = ...\n' + ' File "...testtools...testcase.py", line ..., in _run_test_method\n' +- ' return self._get_test_method()()\n' ++ ' return self._get_test_method()()\n...' + ' result = ...\n' + ' self = ...\n' + ' File "...testtools...tests...test_testresult.py", line ..., in error\n' +- ' 1/0\n' ++ ' 1/0\n...' + ' a = 1\n' + ' self = ...\n' + 'ZeroDivisionError: ...\n', +@@ -2645,12 +2645,15 @@ class TestNonAsciiResults(TestCase): + " raise RuntimeError\n" + " def __repr__(self):\n" + " raise RuntimeError\n") ++ if sys.version_info >= (3, 11): ++ expected = "UnprintableError: \n" ++ else: ++ expected = ( ++ "UnprintableError: \n") + textoutput = self._test_external_case( + modulelevel=exception_class, + testline="raise UnprintableError") +- self.assertIn(self._as_output( +- "UnprintableError: \n"), +- textoutput) ++ self.assertIn(self._as_output(expected), textoutput) + + def test_non_ascii_dirname(self): + """Script paths in the traceback can be non-ascii""" diff --git a/python-testtools.spec b/python-testtools.spec index 2e99a2853a69a2073d1f0e3b04b87c2f9745eb27..0ff56ea51692415f52786e354e46d0679eb5feb5 100644 --- a/python-testtools.spec +++ b/python-testtools.spec @@ -1,6 +1,6 @@ Name: python-testtools Version: 2.5.0 -Release: 1 +Release: 2 Summary: Extensions to the Python unit testing framework License: MIT URL: https://launchpad.net/testtools @@ -11,6 +11,7 @@ BuildRequires: python3-traceback2 python3-testscenarios python3-sphinx python3- BuildArch: noarch #https://github.com/testing-cabal/testtools/commit/ec9bb7ed026566688a14be9d8d5d1e4c506e71c0 Patch0: 0001-Add-support-for-Python-3.10.patch +Patch1: 0002-Fix-test-error.patch %description Testtools is a set of extensions to the Python standard library's unit testing framework. These @@ -58,6 +59,9 @@ make PYTHON=%{__python3} check %doc doc/_build/html/* %changelog +* Mon Oct 28 2024 tzing_t - 2.5.0-2 +- Fix test error in build process, support for python 3.11+ + * Wed Oct 26 2022 yaoxin - 2.5.0-1 - Update to 2.5.0