From a57b8ff57a8eb028810b9f432126fa180c6e01f5 Mon Sep 17 00:00:00 2001 From: Rodja Trappe Date: Wed, 31 Jul 2024 07:51:32 +0200 Subject: [PATCH] renamed the pytest plugin from fixtures.py to plugin.py --- examples/authentication/test_authentication.py | 2 +- examples/chat_app/test_chat_app.py | 2 +- examples/pytests/tests/conftest.py | 2 +- nicegui/testing/{fixtures.py => plugin.py} | 0 tests/conftest.py | 2 +- tests/test_download.py | 8 ++++---- 6 files changed, 8 insertions(+), 8 deletions(-) rename nicegui/testing/{fixtures.py => plugin.py} (100%) diff --git a/examples/authentication/test_authentication.py b/examples/authentication/test_authentication.py index 5570e9efb..4ba056eab 100644 --- a/examples/authentication/test_authentication.py +++ b/examples/authentication/test_authentication.py @@ -6,7 +6,7 @@ # pylint: disable=missing-function-docstring -pytest_plugins = ['nicegui.testing.fixtures'] +pytest_plugins = ['nicegui.testing.plugin'] @pytest.mark.module_under_test(main) diff --git a/examples/chat_app/test_chat_app.py b/examples/chat_app/test_chat_app.py index 9564af09a..7a0f21fff 100644 --- a/examples/chat_app/test_chat_app.py +++ b/examples/chat_app/test_chat_app.py @@ -7,7 +7,7 @@ from . import main -pytest_plugins = ['nicegui.testing.fixtures'] +pytest_plugins = ['nicegui.testing.plugin'] @pytest.mark.module_under_test(main) diff --git a/examples/pytests/tests/conftest.py b/examples/pytests/tests/conftest.py index 8ae72baa9..e5b037ad0 100644 --- a/examples/pytests/tests/conftest.py +++ b/examples/pytests/tests/conftest.py @@ -5,7 +5,7 @@ from nicegui.testing import Screen, User -pytest_plugins = ['nicegui.testing.fixtures'] +pytest_plugins = ['nicegui.testing.plugin'] @pytest.fixture diff --git a/nicegui/testing/fixtures.py b/nicegui/testing/plugin.py similarity index 100% rename from nicegui/testing/fixtures.py rename to nicegui/testing/plugin.py diff --git a/tests/conftest.py b/tests/conftest.py index 6f32d3de3..b065af2cf 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -1 +1 @@ -pytest_plugins = ['nicegui.testing.fixtures'] +pytest_plugins = ['nicegui.testing.plugin'] diff --git a/tests/test_download.py b/tests/test_download.py index bfa8aaeae..93a108f46 100644 --- a/tests/test_download.py +++ b/tests/test_download.py @@ -5,7 +5,7 @@ from fastapi.responses import PlainTextResponse from nicegui import app, ui -from nicegui.testing import Screen, fixtures +from nicegui.testing import Screen, plugin @pytest.fixture @@ -25,7 +25,7 @@ def test(): screen.open('/') screen.click('Download') screen.wait(0.5) - assert (fixtures.DOWNLOAD_DIR / 'test.txt').read_text() == 'test' + assert (plugin.DOWNLOAD_DIR / 'test.txt').read_text() == 'test' def test_downloading_local_file_as_src(screen: Screen): @@ -36,7 +36,7 @@ def test_downloading_local_file_as_src(screen: Screen): route_count_before_download = len(app.routes) screen.click('download') screen.wait(0.5) - assert (fixtures.DOWNLOAD_DIR / 'slide1.jpg').exists() + assert (plugin.DOWNLOAD_DIR / 'slide1.jpg').exists() assert len(app.routes) == route_count_before_download @@ -46,4 +46,4 @@ def test_download_raw_data(screen: Screen): screen.open('/') screen.click('download') screen.wait(0.5) - assert (fixtures.DOWNLOAD_DIR / 'test.txt').read_text() == 'test' + assert (plugin.DOWNLOAD_DIR / 'test.txt').read_text() == 'test'