From a9515ab6777e5afb0c92e1e14f7a0a409f9131ca Mon Sep 17 00:00:00 2001 From: Ben Plowman Date: Thu, 6 Feb 2020 18:17:10 -0800 Subject: [PATCH 1/4] Remove deprecated werkzeug import This breaks with werkzeug 1.0. Werkzeug was previously generating this warning: DeprecationWarning: The import 'werkzeug.cached_property' is deprecated and will be removed in Werkzeug 1.0. Use 'from werkzeug.utils import cached_property' instead. --- flask_restx/api.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/flask_restx/api.py b/flask_restx/api.py index d8e0d3a2..6174d7ff 100644 --- a/flask_restx/api.py +++ b/flask_restx/api.py @@ -25,7 +25,7 @@ from jsonschema import RefResolver -from werkzeug import cached_property +from werkzeug.utils import cached_property from werkzeug.datastructures import Headers from werkzeug.exceptions import HTTPException, MethodNotAllowed, NotFound, NotAcceptable, InternalServerError from werkzeug.wrappers import BaseResponse From 51dd3e38df0b5058d693f092d7c60dd6f75f4380 Mon Sep 17 00:00:00 2001 From: Ben Plowman Date: Thu, 6 Feb 2020 18:46:31 -0800 Subject: [PATCH 2/4] Bump pytest-flask to 0.15.1 --- requirements/test.pip | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements/test.pip b/requirements/test.pip index 984f897a..2fe326ad 100644 --- a/requirements/test.pip +++ b/requirements/test.pip @@ -5,7 +5,7 @@ pytest==4.6.5; python_version < '3.5' pytest==5.0.1; python_version >= '3.5' pytest-benchmark==3.2.2 pytest-cov==2.7.1 -pytest-flask==0.15.0 +pytest-flask==0.15.1 pytest-mock==1.10.4 pytest-profiling==1.7.0 pytest-sugar==0.9.2 From ce907d25eb7915a067883315d132cf2cf93c8864 Mon Sep 17 00:00:00 2001 From: Ben Plowman Date: Thu, 6 Feb 2020 18:53:44 -0800 Subject: [PATCH 3/4] Fix content type assertion --- tests/test_errors.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/test_errors.py b/tests/test_errors.py index 421a4f5c..79cbb2b9 100644 --- a/tests/test_errors.py +++ b/tests/test_errors.py @@ -413,7 +413,7 @@ def test_handle_non_api_error(self, app, client): response = client.get("/foo") assert response.status_code == 404 - assert response.headers['Content-Type'] == 'text/html' + assert response.headers['Content-Type'] == 'text/html; charset=utf-8' def test_non_api_error_404_catchall(self, app, client): api = restx.Api(app, catch_all_404s=True) From 0f1f12ff2172f7eda804ab83789384e66ba1317c Mon Sep 17 00:00:00 2001 From: Ben Steadman Date: Sat, 8 Feb 2020 06:37:49 +0000 Subject: [PATCH 4/4] WIP coveralls env var --- .github/workflows/test.yml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index b142cb80..3396915a 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -22,11 +22,12 @@ jobs: - name: Test with inv run: inv cover qa - name: Coveralls + env: + COVERALLS_REPO_TOKEN: ${{ secrets.COVERALLS_REPO_TOKEN }} run: | pip install coveralls coveralls --rcfile=coverage.rc - env: - COVERALLS_REPO_TOKEN: ${{ secrets.COVERALLS_REPO_TOKEN }} + bench: needs: test runs-on: ubuntu-latest