Skip to content

Commit 77ed410

Browse files
author
Andrei Neagu
committed
moved parametrization to fixture
1 parent c763594 commit 77ed410

File tree

6 files changed

+12
-8
lines changed

6 files changed

+12
-8
lines changed
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
import pytest
2+
3+
4+
@pytest.fixture
5+
def use_internal_scheduler() -> bool:
6+
return True

services/dynamic-scheduler/tests/unit/api_frontend/_routes_internal_scheduler/test__index_.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
# pylint:disable=redefined-outer-name
22
# pylint:disable=unused-argument
33

4-
import pytest
54
from helpers import assert_contains_text
65
from playwright.async_api import Page
76
from simcore_service_dynamic_scheduler.api.frontend._utils import get_settings
@@ -17,7 +16,6 @@
1716
]
1817

1918

20-
@pytest.mark.parametrize("use_internal_scheduler", [True])
2119
async def test_placeholder_index(
2220
app_runner: None, async_page: Page, server_host_port: str
2321
):

services/dynamic-scheduler/tests/unit/api_frontend/conftest.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ def disable_status_monitor_background_task(mocker: MockerFixture) -> None:
3636
def app_environment(
3737
monkeypatch: pytest.MonkeyPatch,
3838
app_environment: EnvVarsDict,
39-
use_internal_scheduler: bool, # has to be added to every test
39+
use_internal_scheduler: bool,
4040
postgres_db: sa.engine.Engine,
4141
postgres_host_config: PostgresTestConfig,
4242
disable_status_monitor_background_task: None,

services/dynamic-scheduler/tests/unit/api_frontend/routes_external_scheduler/conftest.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,11 @@
1111
)
1212

1313

14+
@pytest.fixture
15+
def use_internal_scheduler() -> bool:
16+
return False
17+
18+
1419
@pytest.fixture
1520
def mock_stop_dynamic_service(mocker: MockerFixture) -> AsyncMock:
1621
async_mock = AsyncMock()

services/dynamic-scheduler/tests/unit/api_frontend/routes_external_scheduler/test__index.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,6 @@
4242
]
4343

4444

45-
@pytest.mark.parametrize("use_internal_scheduler", [False])
4645
async def test_index_with_elements(
4746
app_runner: None,
4847
async_page: Page,
@@ -70,7 +69,6 @@ async def test_index_with_elements(
7069
await assert_contains_text(async_page, "Details", instances=2)
7170

7271

73-
@pytest.mark.parametrize("use_internal_scheduler", [False])
7472
@pytest.mark.parametrize(
7573
"service_status",
7674
[

services/dynamic-scheduler/tests/unit/api_frontend/routes_external_scheduler/test__service.py

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,6 @@
3838
]
3939

4040

41-
@pytest.mark.parametrize("use_internal_scheduler", [False])
4241
async def test_service_details_no_status_present(
4342
app_runner: None,
4443
async_page: Page,
@@ -67,7 +66,6 @@ async def test_service_details_no_status_present(
6766
await assert_contains_text(async_page, "Remove from tracking", instances=1)
6867

6968

70-
@pytest.mark.parametrize("use_internal_scheduler", [False])
7169
async def test_service_details_renders_friendly_404(
7270
app_runner: None, async_page: Page, server_host_port: str, node_id: NodeID
7371
):
@@ -77,7 +75,6 @@ async def test_service_details_renders_friendly_404(
7775
await assert_contains_text(async_page, "Sorry could not find any details for")
7876

7977

80-
@pytest.mark.parametrize("use_internal_scheduler", [False])
8178
@pytest.mark.parametrize(
8279
"service_status",
8380
[

0 commit comments

Comments
 (0)