diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index c32a9ab..a279af9 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -37,5 +37,5 @@ jobs: key: ${{ runner.os }}-node-${{ hashFiles('.nvmrc', 'package.json', 'package-lock.json') }} - name: Run tests run: | - pip install $(grep "^tox==" requirements/local.txt) + pip install $(grep -E "^(tox|tox-uv)==" requirements/local.txt) tox -e ${{ matrix.testenv }} diff --git a/requirements/local.txt b/requirements/local.txt index b3583ee..9303029 100644 --- a/requirements/local.txt +++ b/requirements/local.txt @@ -1,3 +1,4 @@ -r testing.txt -tox==4.15.1 +tox==4.23.2 +tox-uv==1.16.0 diff --git a/{{cookiecutter.project_slug}}/.github/workflows/ci.yml b/{{cookiecutter.project_slug}}/.github/workflows/ci.yml index c3bfdd1..5feceb9 100644 --- a/{{cookiecutter.project_slug}}/.github/workflows/ci.yml +++ b/{{cookiecutter.project_slug}}/.github/workflows/ci.yml @@ -32,5 +32,5 @@ jobs: key: ${{ runner.os }}-node-${{ hashFiles('.nvmrc', 'package.json', 'package-lock.json') }} - name: Run tests run: | - pip install $(grep "^tox==" requirements/local.txt) + pip install $(grep -E "^(tox|tox-uv)==" requirements/local.txt) tox diff --git a/{{cookiecutter.project_slug}}/requirements/local.txt b/{{cookiecutter.project_slug}}/requirements/local.txt index 144eafd..e8a0301 100644 --- a/{{cookiecutter.project_slug}}/requirements/local.txt +++ b/{{cookiecutter.project_slug}}/requirements/local.txt @@ -2,3 +2,4 @@ ipdb==0.13.13 tox==4.23.2 +tox-uv==1.16.0 diff --git a/{{cookiecutter.project_slug}}/requirements/testing.txt b/{{cookiecutter.project_slug}}/requirements/testing.txt index 38976f4..bd3a7f3 100644 --- a/{{cookiecutter.project_slug}}/requirements/testing.txt +++ b/{{cookiecutter.project_slug}}/requirements/testing.txt @@ -3,7 +3,6 @@ black==24.10.0 coverage==7.6.4 flake8==7.1.1 -Flask-WebTest==0.1.6 isort==5.13.2 pipdeptree==2.23.4 pytest-flask==1.3.0 diff --git a/{{cookiecutter.project_slug}}/tests/conftest.py b/{{cookiecutter.project_slug}}/tests/conftest.py index a576754..504ef74 100644 --- a/{{cookiecutter.project_slug}}/tests/conftest.py +++ b/{{cookiecutter.project_slug}}/tests/conftest.py @@ -1,9 +1,8 @@ import pytest -from flask_webtest import TestApp -from project import app +import project @pytest.fixture -def flask_webtest(request): - request.cls.app = TestApp(app) +def app(): + return project.app diff --git a/{{cookiecutter.project_slug}}/tests/test_views.py b/{{cookiecutter.project_slug}}/tests/test_views.py index d13e98b..8ccf437 100644 --- a/{{cookiecutter.project_slug}}/tests/test_views.py +++ b/{{cookiecutter.project_slug}}/tests/test_views.py @@ -3,10 +3,10 @@ import pytest -@pytest.mark.usefixtures("flask_webtest") +@pytest.mark.usefixtures("client_class") class TestViews(unittest.TestCase): def test_root(self): - response = self.app.get("/") + response = self.client.get("/") - assert response.status_int == 200 - assert "Hello, world!" in response + assert response.status_code == 200 + assert "Hello, world!" in response.get_data(as_text=True)