From ffcd8c3e65d611ad3d696f5a2f2d097a532eb21a Mon Sep 17 00:00:00 2001 From: Lucas Druschke Date: Tue, 19 Nov 2019 12:33:52 +0100 Subject: [PATCH 1/3] update travis and tox config to python 3.5-3.8 --- .travis.yml | 5 ++++- tox.ini | 2 +- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/.travis.yml b/.travis.yml index e27ffd5..d5d303a 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,7 +1,10 @@ language: python env: - TOXENV=py27 -- TOXENV=py33 +- TOXENV=py35 +- TOXENV=py36 +- TOXENV=py37 +- TOXENV=py38 install: pip install tox script: tox services: diff --git a/tox.ini b/tox.ini index a2fd8d0..d7dd3ae 100644 --- a/tox.ini +++ b/tox.ini @@ -1,5 +1,5 @@ [tox] -envlist = py27,py33 +envlist = py27,py35,py36,py37,py38 [testenv] deps= From ce0d38e2d11f9f86d63fab4226733776383708cf Mon Sep 17 00:00:00 2001 From: Lucas Druschke Date: Tue, 19 Nov 2019 14:01:29 +0100 Subject: [PATCH 2/3] fix deprecations in pytest --- tests/conftest.py | 16 ++++++++++++---- tests/test_expiration.py | 6 +++--- 2 files changed, 15 insertions(+), 7 deletions(-) diff --git a/tests/conftest.py b/tests/conftest.py index efecd1d..23ce0f8 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -36,13 +36,12 @@ def store(request): if request.param == 'dict': return DictStore() elif request.param == 'redis': - return request.getfuncargvalue('redis_store') + return request.getfixturevalue('redis_store') assert False -@pytest.fixture -def client(app): +def _client(app): client = app.test_client() def get_session_cookie(self, path='/'): @@ -56,7 +55,11 @@ def get_session_cookie(self, path='/'): @pytest.fixture -def app(store): +def client(app): + return _client(app) + + +def _app(store): app = Flask(__name__) app.kvsession = KVSessionExtension(store, app) @@ -133,3 +136,8 @@ def destroy_immediately(): return 'PROFIT' return app + + +@pytest.fixture +def app(store): + return _app(store) diff --git a/tests/test_expiration.py b/tests/test_expiration.py index aef313e..ba3cbfe 100644 --- a/tests/test_expiration.py +++ b/tests/test_expiration.py @@ -1,6 +1,6 @@ from datetime import timedelta -from conftest import app as app_, client as client_ +from conftest import _app, _client import pytest @@ -9,12 +9,12 @@ @pytest.fixture def redis_app(redis_store): - return app_(redis_store) + return _app(redis_store) @pytest.fixture def redis_client(redis_app): - return client_(redis_app) + return _client(redis_app) def test_redis_expiration_permanent_session( From 286c3c52d2cf0c7ad5ee83357915e16d75a3dfbd Mon Sep 17 00:00:00 2001 From: Lucas Druschke Date: Tue, 19 Nov 2019 14:08:19 +0100 Subject: [PATCH 3/3] adjust .travis.yml to make python 3.7 and 3.8 available to tox --- .travis.yml | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/.travis.yml b/.travis.yml index d5d303a..c1ec038 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,10 +1,16 @@ language: python -env: -- TOXENV=py27 -- TOXENV=py35 -- TOXENV=py36 -- TOXENV=py37 -- TOXENV=py38 +matrix: + include: + - python: 3.8 + env: TOXENV=py38 + - python: 3.7 + env: TOXENV=py37 + - python: 3.6 + env: TOXENV=py36 + - python: 3.5 + env: TOXENV=py35 + - python: 2.7 + env: TOXENV=py27 install: pip install tox script: tox services: