-
Notifications
You must be signed in to change notification settings - Fork 39
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added test for fixture order. It passes already for all recent pytest…
… versions (after 3.3). Fixes #42
- Loading branch information
Sylvain MARIE
committed
Jun 14, 2019
1 parent
e35dcc2
commit d15c8be
Showing
1 changed file
with
25 additions
and
0 deletions.
There are no files selected for viewing
25 changes: 25 additions & 0 deletions
25
pytest_cases/tests/fixtures/test_fixture_order_respects_scope.py
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,25 @@ | ||
""" | ||
This is a copy of test at https://github.com/pytest-dev/pytest/blob/master/testing/acceptance_test.py | ||
""" | ||
from distutils.version import LooseVersion | ||
|
||
import pytest | ||
|
||
data = {} | ||
|
||
|
||
@pytest.fixture(scope='module') | ||
def clean_data(): | ||
data.clear() | ||
|
||
|
||
@pytest.fixture(autouse=True) | ||
def add_data(): | ||
data.update(value=True) | ||
|
||
|
||
@pytest.mark.skipif(LooseVersion(pytest.__version__) < LooseVersion('3.4.0'), | ||
reason="This bug was not fixed in old pytest.") | ||
@pytest.mark.usefixtures('clean_data') | ||
def test_value(): | ||
assert data.get('value') |