Skip to content

Commit d57d8f3

Browse files
committed
Do not auto update fixtures from return to yield statements
1 parent 7f4eb86 commit d57d8f3

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

ruff.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ extend-exclude = [
1414
extend-ignore = [
1515
"E501", # E501: Line too long
1616
"PT011", # PT011 `pytest.raises(ValueError)` is too broad
17+
"PT022", # PT022 [*] No teardown in fixture
1718
# Conflicting lint rules: https://docs.astral.sh/ruff/formatter/#conflicting-lint-rules
1819
"E111", # * indentation-with-invalid-multiple (E111)
1920
"E114", # * indentation-with-invalid-multiple-comment (E114)

tests/playwright/conftest.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -234,7 +234,7 @@ def fixture_func():
234234
# Pass through `yield` via `next(...)` call
235235
# (`yield` must be on same line as `next`!)
236236
app_gen = local_app_fixture_gen(app)
237-
return next(app_gen)
237+
yield next(app_gen)
238238

239239
return fixture_func
240240

@@ -285,9 +285,9 @@ def x_create_doc_example_fixture(example_name: str, scope: ScopeName = "module")
285285

286286

287287
@pytest.fixture(scope="module")
288-
def local_app(request: pytest.FixtureRequest) -> ShinyAppProc:
288+
def local_app(request: pytest.FixtureRequest) -> Generator[ShinyAppProc, None, None]:
289289
app_gen = local_app_fixture_gen(PurePath(request.path).parent / "app.py")
290-
return next(app_gen)
290+
yield next(app_gen)
291291

292292

293293
@contextmanager

0 commit comments

Comments
 (0)