Skip to content

Commit

Permalink
Added test for fixture order. It passes already for all recent pytest…
Browse files Browse the repository at this point in the history
… 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.
25 changes: 25 additions & 0 deletions pytest_cases/tests/fixtures/test_fixture_order_respects_scope.py
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')

0 comments on commit d15c8be

Please sign in to comment.