]> git.pld-linux.org Git - packages/python-flask.git/blob - python-flask-python3.6.patch
- updated to 0.12
[packages/python-flask.git] / python-flask-python3.6.patch
1 From 01b992b1a1482246d705ffe3b3d0dd7816f0456b Mon Sep 17 00:00:00 2001
2 From: Andrew Arendt <AndrewArendt@gmail.com>
3 Date: Tue, 10 Jan 2017 11:20:53 -0600
4 Subject: [PATCH] Added python3.6 support for tests
5
6 ---
7  .travis.yml         | 6 +++++-
8  tests/test_basic.py | 2 +-
9  tests/test_ext.py   | 4 ++--
10  tox.ini             | 2 +-
11  4 files changed, 9 insertions(+), 5 deletions(-)
12
13 diff --git a/tests/test_basic.py b/tests/test_basic.py
14 index be3d5ed..a099c90 100644
15 --- a/tests/test_basic.py
16 +++ b/tests/test_basic.py
17 @@ -333,7 +333,7 @@ def test():
18      client = app.test_client()
19      rv = client.get('/')
20      assert 'set-cookie' in rv.headers
21 -    match = re.search(r'\bexpires=([^;]+)(?i)', rv.headers['set-cookie'])
22 +    match = re.search(r'(?i)\bexpires=([^;]+)', rv.headers['set-cookie'])
23      expires = parse_date(match.group())
24      expected = datetime.utcnow() + app.permanent_session_lifetime
25      assert expires.year == expected.year
26 diff --git a/tests/test_ext.py b/tests/test_ext.py
27 index d336e40..ebb5f02 100644
28 --- a/tests/test_ext.py
29 +++ b/tests/test_ext.py
30 @@ -179,8 +179,8 @@ def test_flaskext_broken_package_no_module_caching(flaskext_broken):
31  def test_no_error_swallowing(flaskext_broken):
32      with pytest.raises(ImportError) as excinfo:
33          import flask.ext.broken
34 -
35 -    assert excinfo.type is ImportError
36 +    # python3.6 raises a subclass of ImportError: 'ModuleNotFoundError'
37 +    assert issubclass(excinfo.type, ImportError)
38      if PY2:
39          message = 'No module named missing_module'
40      else:
This page took 0.026389 seconds and 3 git commands to generate.