-
-
Notifications
You must be signed in to change notification settings - Fork 2.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #8160 from nicoddemus/backport-7381
[6.2.x] Clarify fixture execution order and provide visual aids (#7381)
- Loading branch information
Showing
19 changed files
with
2,413 additions
and
454 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
142 changes: 142 additions & 0 deletions
142
doc/en/example/fixtures/fixture_availability_plugins.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
import pytest | ||
|
||
|
||
@pytest.fixture | ||
def order(): | ||
return [] | ||
|
||
|
||
@pytest.fixture | ||
def a(order): | ||
order.append("a") | ||
|
||
|
||
@pytest.fixture | ||
def b(a, order): | ||
order.append("b") | ||
|
||
|
||
@pytest.fixture(autouse=True) | ||
def c(b, order): | ||
order.append("c") | ||
|
||
|
||
@pytest.fixture | ||
def d(b, order): | ||
order.append("d") | ||
|
||
|
||
@pytest.fixture | ||
def e(d, order): | ||
order.append("e") | ||
|
||
|
||
@pytest.fixture | ||
def f(e, order): | ||
order.append("f") | ||
|
||
|
||
@pytest.fixture | ||
def g(f, c, order): | ||
order.append("g") | ||
|
||
|
||
def test_order_and_g(g, order): | ||
assert order == ["a", "b", "c", "d", "e", "f", "g"] |
Oops, something went wrong.