From 56980e04ce37f988a0a92803867f2a5cf315685d Mon Sep 17 00:00:00 2001 From: Kenneth Kehl <@kkehl@flexion.us> Date: Wed, 4 Jun 2025 11:22:28 -0700 Subject: [PATCH] try pytest-asyncio again --- pyproject.toml | 3 +++ tests/app/main/views/test_templates.py | 1 + tests/end_to_end/test_create_new_template.py | 4 +++- 3 files changed, 7 insertions(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index 29233c4b9..1d4f6db61 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -90,6 +90,7 @@ moto = "*" pip-audit = "*" pre-commit = "^4.2.0" pytest = "^8.3.2" +pytest-asyncio = "^1.0.0" pytest-env = "^1.1.3" pytest-mock = "^3.14.1" pytest-playwright = "^0.7.0" @@ -99,6 +100,8 @@ requests-mock = "^1.11.0" vulture = "^2.14" poetry-dotenv-plugin = "^0.2.0" +[tool.pytest.ini_options] +asyncio_mode = "auto" [build-system] requires = ["poetry-core"] diff --git a/tests/app/main/views/test_templates.py b/tests/app/main/views/test_templates.py index aa43727b2..7599ac8d6 100644 --- a/tests/app/main/views/test_templates.py +++ b/tests/app/main/views/test_templates.py @@ -1744,6 +1744,7 @@ def test_can_create_email_template_with_emoji( ) assert mock_create_service_template.called is True + # TODO FIX! # @pytest.mark.parametrize( # ("template_type", "expected_error"), diff --git a/tests/end_to_end/test_create_new_template.py b/tests/end_to_end/test_create_new_template.py index 328e32a81..0780839a5 100644 --- a/tests/end_to_end/test_create_new_template.py +++ b/tests/end_to_end/test_create_new_template.py @@ -3,6 +3,7 @@ import os import re import uuid +import pytest from playwright.sync_api import expect from tests.end_to_end.conftest import check_axe_report @@ -97,7 +98,8 @@ async def create_new_template(page): assert "Test message for e2e test" in page.content() -def test_create_new_template(end_to_end_context): +@pytest.mark.asyncio +async def test_create_new_template(end_to_end_context): page = end_to_end_context.new_page() page.goto(f"{E2E_TEST_URI}/sign-in") # Wait for the next page to fully load.