Practise the standard verbs for scoping pytest fixtures correctly.
0 / 5 completed
1 / 5
Fill in: 'We ___ a fixture's scope to session when setup is expensive and safe to share across every test.'
We 'set scope' — the standard, simple collocation for configuring a fixture's lifetime. The other options are less idiomatic here.
2 / 5
Fill in: 'A session-scoped fixture with mutable state can ___ one test's leftover changes leaking into the next.'
We say shared mutable state will 'cause' leakage between tests — the standard collocation for the resulting problem. The other options aren't idiomatic here.
3 / 5
Fill in: 'We ___ a fixture in conftest.py so every test file in the directory can use it without a separate import.'
We 'define a fixture' — the standard, established pytest collocation for declaring reusable setup. The other options aren't the recognised term here.
4 / 5
Fill in: 'We ___ teardown logic after the yield so a fixture always cleans up even when the test itself fails.'
We 'run teardown' — the standard, simple collocation for executing cleanup code. The other options are less idiomatic here.
5 / 5
Fill in: 'We ___ fixture scope carefully between function and module so isolation and speed stay balanced.'
We 'balance' a trade-off — the standard collocation for weighing competing concerns. The other options aren't idiomatic here.