From 057873de3d3c55bad1562e237a22b4f4fa1f6edf Mon Sep 17 00:00:00 2001 From: caodongxia <315816521@qq.com> Date: Sat, 8 Jan 2022 16:02:17 +0800 Subject: [PATCH] fix test fail due to python3.9 --- python-testtools.spec | 6 +++++- testtools-2.4.0-fix_py39_test.patch | 14 ++++++++++++++ 2 files changed, 19 insertions(+), 1 deletion(-) create mode 100644 testtools-2.4.0-fix_py39_test.patch diff --git a/python-testtools.spec b/python-testtools.spec index 11600a4..1eb8212 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 0000000..bbcf8e4 --- /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 -- Gitee