Python 3.8 support in tests
This commit is contained in:
parent
7374dd1f2f
commit
b3416ecb55
@ -20,6 +20,10 @@ Patch0: 1293.patch
|
||||
# Use sys.executable in tests
|
||||
Patch1: https://github.com/pallets/werkzeug/pull/1455.patch
|
||||
|
||||
# Python 3.8 support in tests
|
||||
# https://github.com/pallets/werkzeug/commit/e060800e8e6e0c611f9439d746bd4da99a314b79
|
||||
Patch2: python38.patch
|
||||
|
||||
BuildArch: noarch
|
||||
|
||||
%global _description\
|
||||
|
27
python38.patch
Normal file
27
python38.patch
Normal file
@ -0,0 +1,27 @@
|
||||
diff --git a/tests/test_utils.py b/tests/test_utils.py
|
||||
index 0ead561..ba46887 100644
|
||||
--- a/tests/test_utils.py
|
||||
+++ b/tests/test_utils.py
|
||||
@@ -174,16 +174,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…
Reference in New Issue
Block a user