Skip to content

Commit 42cf9c3

Browse files
authored
Skip fixture setup if test is skipped or xfailed (#32)
1 parent 2c6f8c1 commit 42cf9c3

1 file changed

Lines changed: 6 additions & 0 deletions

File tree

tests/conftest.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,12 @@ def pywrangler_dev_server(directory: str):
6969
@pytest.fixture
7070
def dev_server(request):
7171
"""Fixture that starts a dev server for the appropriate directory based on test name."""
72+
if request.node.get_closest_marker("skip") or request.node.get_closest_marker(
73+
"xfail"
74+
):
75+
yield
76+
return
77+
7278
test_name = request.node.name
7379
# Extract directory name from test name (e.g., "test_01_hello" -> "01-hello")
7480
dir_name = test_name.replace("test_", "").replace("_", "-")

0 commit comments

Comments
 (0)