Skip to content

Commit cd93ccb

Browse files
committed
test(sqlserver): isolate live partition fixtures per test
1 parent be521d2 commit cd93ccb

1 file changed

Lines changed: 9 additions & 4 deletions

File tree

‎tests/rhosocial/activerecord_sqlserver_test/feature/backend/test_sqlserver_partition_live.py‎

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -68,9 +68,9 @@ def _cleanup(backend):
6868
pass
6969

7070

71-
@pytest.fixture(scope="module")
71+
@pytest.fixture(scope="function")
7272
def partition_backend():
73-
"""A backend against the first scenario, or a skip when unavailable."""
73+
"""A backend against the first scenario for one test, or a skip when unavailable."""
7474
scenarios = get_enabled_scenarios()
7575
if not scenarios:
7676
pytest.skip("No SQL Server scenarios configured")
@@ -92,9 +92,14 @@ def partition_backend():
9292
backend.disconnect()
9393

9494

95-
@pytest.fixture(scope="module")
95+
@pytest.fixture(scope="function")
9696
def partition_fixture(partition_backend):
97-
"""A real function, scheme and partitioned table with four partitions."""
97+
"""A real function, scheme and partitioned table with four partitions.
98+
99+
Rebuilt for every test: the split and merge tests mutate the function, and
100+
xdist is free to run those on a different worker than the tests that expect
101+
the four-partition baseline.
102+
"""
98103
maintenance = SQLServerPartitionMaintenance(partition_backend)
99104
plan = _plan()
100105
report = maintenance.ensure(plan)

0 commit comments

Comments
 (0)