diff --git a/python-testtools.spec b/python-testtools.spec index 11600a4e35afaf93b94a2c58fe08f2eb578f28e9..1eb8212e4b998f17d478da51da2accbeead4f7ec 100644 --- a/python-testtools.spec +++ b/python-testtools.spec @@ -1,6 +1,6 @@ Name: python-testtools Version: 2.4.0 -Release: 1 +Release: 2 Summary: Extensions to the Python unit testing framework License: MIT URL: https://launchpad.net/testtools @@ -10,6 +10,7 @@ BuildRequires: python3-extras python3-mimeparse python3-pbr python3-setuptools BuildRequires: python3-traceback2 python3-testscenarios python3-sphinx python3-devel BuildArch: noarch Patch0: testtools-2.4.0-fix-py3-compat.patch +Patch1: testtools-2.4.0-fix_py39_test.patch %description Testtools is a set of extensions to the Python standard library's unit testing framework. These @@ -56,6 +57,9 @@ make PYTHON=%{__python3} check %doc doc/_build/html/* %changelog +* Sat Jan 08 2021 caodongxia - 2.4.0-2 +- Fix test fail + * Fri Aug 06 2021 liusheng - 2.4.0-1 - Upgrade to version 2.4.0 diff --git a/testtools-2.4.0-fix_py39_test.patch b/testtools-2.4.0-fix_py39_test.patch new file mode 100644 index 0000000000000000000000000000000000000000..bbcf8e4f2588bcebc9c5b21d9f22db1a20b196d3 --- /dev/null +++ b/testtools-2.4.0-fix_py39_test.patch @@ -0,0 +1,14 @@ +diff -ru testtools-2.4.0-orig/testtools/tests/test_testresult.py testtools-2.4.0/testtools/tests/test_testresult.py +--- testtools-2.4.0-orig/testtools/tests/test_testresult.py 2019-11-28 00:58:29.000000000 -0800 ++++ testtools-2.4.0/testtools/tests/test_testresult.py 2020-05-16 13:40:50.141580104 -0700 +@@ -2755,6 +2755,9 @@ + textoutput = self._setup_external_case("import bad") + self._write_module("bad", "utf-8", _u("\ufeff^ = 0 # %s\n") % text) + textoutput = self._run_external_case() ++ # Python 3.9 no longer prints the '\ufeff' ++ if sys.version_info >= (3,9): ++ textoutput = textoutput.replace('\ufeff', '') + self.assertThat( + textoutput, + MatchesRegex( + \ No newline at end of file