Added python3.6 support for tests

This commit is contained in:
Andrew Arendt 2017-01-10 11:20:53 -06:00
parent 88111ae6bf
commit 01b992b1a1
4 changed files with 9 additions and 5 deletions

View file

@ -333,7 +333,7 @@ def test_session_expiration():
client = app.test_client()
rv = client.get('/')
assert 'set-cookie' in rv.headers
match = re.search(r'\bexpires=([^;]+)(?i)', rv.headers['set-cookie'])
match = re.search(r'(?i)\bexpires=([^;]+)', rv.headers['set-cookie'])
expires = parse_date(match.group())
expected = datetime.utcnow() + app.permanent_session_lifetime
assert expires.year == expected.year

View file

@ -179,8 +179,8 @@ def test_flaskext_broken_package_no_module_caching(flaskext_broken):
def test_no_error_swallowing(flaskext_broken):
with pytest.raises(ImportError) as excinfo:
import flask.ext.broken
assert excinfo.type is ImportError
# python3.6 raises a subclass of ImportError: 'ModuleNotFoundError'
assert issubclass(excinfo.type, ImportError)
if PY2:
message = 'No module named missing_module'
else: