fix test fail with python3.8
This commit is contained in:
parent
da824dbb2c
commit
6923f2c647
@ -4,7 +4,7 @@
|
||||
Name: python-werkzeug
|
||||
Summary: A comprehensive WSGI web application library
|
||||
Version: 0.14.1
|
||||
Release: 6
|
||||
Release: 7
|
||||
License: BSD
|
||||
URL: http://werkzeug.pocoo.org/
|
||||
Source0: https://files.pythonhosted.org/packages/source/W/Werkzeug/%{srcname}-%{version}.tar.gz
|
||||
@ -14,6 +14,8 @@ Source1: https://github.com/pallets/werkzeug/archive/0.14.1.tar.gz
|
||||
# skip tests that use a fixture called 'subprocess' when pytest-xprocess
|
||||
# is not installed
|
||||
Patch0: Skip-tests-that-use-xprocess-fixture-when-not-installed.patch
|
||||
# Fix test fail with python3.8
|
||||
Patch1: werkzeug-fix-tests-for-nightly-and-osx.patch
|
||||
|
||||
%global _description\
|
||||
Werkzeug is a comprehensive WSGI web application library. It began as a\
|
||||
@ -86,7 +88,7 @@ Documentation and examples for python3-werkzeug.
|
||||
|
||||
|
||||
%prep
|
||||
%autosetup -n %{srcname}-%{version} -p1 -Sgit
|
||||
%autosetup -n %{srcname}-%{version} -p1
|
||||
%{__sed} -i 's/\r//' LICENSE
|
||||
%{__sed} -i '1d' tests/multipart/test_collect.py
|
||||
tar -xf %{SOURCE1}
|
||||
@ -156,5 +158,8 @@ popd
|
||||
|
||||
|
||||
%changelog
|
||||
* Wed Jun 24 2020 lingsheng <lingsheng@huawei.com> - 0.14.1-7
|
||||
- Fix test fail with python3.8
|
||||
|
||||
* Mon Nov 4 2019 openEuler Buildteam <buildteam@openeuler.org> - 0.14.1-4
|
||||
- Package init
|
||||
|
||||
36
werkzeug-fix-tests-for-nightly-and-osx.patch
Normal file
36
werkzeug-fix-tests-for-nightly-and-osx.patch
Normal file
@ -0,0 +1,36 @@
|
||||
From e060800e8e6e0c611f9439d746bd4da99a314b79 Mon Sep 17 00:00:00 2001
|
||||
From: David Lord <davidism@gmail.com>
|
||||
Date: Tue, 12 Feb 2019 08:32:59 -0800
|
||||
Subject: [PATCH] fix tests for nightly and osx
|
||||
|
||||
---
|
||||
tests/test_utils.py | 12 ++++++------
|
||||
1 files changed, 6 insertions(+), 6 deletions(-)
|
||||
|
||||
diff --git a/tests/test_utils.py b/tests/test_utils.py
|
||||
index 5a6a3f523..6de22b3d5 100644
|
||||
--- a/tests/test_utils.py
|
||||
+++ b/tests/test_utils.py
|
||||
@@ -161,16 +161,16 @@ def test_unescape():
|
||||
|
||||
|
||||
def test_import_string():
|
||||
- import cgi
|
||||
+ from datetime import date
|
||||
from werkzeug.debug import DebuggedApplication
|
||||
- assert utils.import_string('cgi.escape') is cgi.escape
|
||||
- assert utils.import_string(u'cgi.escape') is cgi.escape
|
||||
- assert utils.import_string('cgi:escape') is cgi.escape
|
||||
+ assert utils.import_string('datetime.date') is date
|
||||
+ assert utils.import_string(u'datetime.date') is date
|
||||
+ assert utils.import_string('datetime:date') is date
|
||||
assert utils.import_string('XXXXXXXXXXXX', True) is None
|
||||
- assert utils.import_string('cgi.XXXXXXXXXXXX', True) is None
|
||||
+ assert utils.import_string('datetime.XXXXXXXXXXXX', True) is None
|
||||
assert utils.import_string(u'werkzeug.debug.DebuggedApplication') is DebuggedApplication
|
||||
pytest.raises(ImportError, utils.import_string, 'XXXXXXXXXXXXXXXX')
|
||||
- pytest.raises(ImportError, utils.import_string, 'cgi.XXXXXXXXXX')
|
||||
+ pytest.raises(ImportError, utils.import_string, 'datetime.XXXXXXXXXX')
|
||||
|
||||
|
||||
def test_import_string_attribute_error(tmpdir, monkeypatch):
|
||||
Loading…
x
Reference in New Issue
Block a user