Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

If 2 fixtures without parameters are used in a fixture union, their setup/teardown should be done in sequence too #38

Closed
smarie opened this issue Apr 5, 2019 · 2 comments
Labels
enhancement New feature or request

Comments

@smarie
Copy link
Owner

smarie commented Apr 5, 2019

No description provided.

@smarie smarie added bug Something isn't working enhancement New feature or request and removed bug Something isn't working labels Apr 5, 2019
@smarie
Copy link
Owner Author

smarie commented Apr 5, 2019

... and only once !

from pytest_cases import pytest_fixture_plus, fixture_union

state = -1

@pytest_fixture_plus
def a():
    global state
    state = 0
    yield
    state = 1

@pytest_fixture_plus
def b():
    global state
    state = 2
    yield
    state = 3

c = fixture_union('c', [b, a])

def test_all(c):
    pass

def test_synthesis():
    assert state == 3

@smarie
Copy link
Owner Author

smarie commented Apr 5, 2019

This was an issue with @pytest_fixture_plus not correctly handling the NOT_USED parameter, that is actually added in the list so each fixture is called twice.

@smarie smarie closed this as completed in f220f6e Apr 5, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant