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

@pytest.mark.usefixtures take no effects on fixtures #378

Closed
pytestbot opened this issue Nov 1, 2013 · 1 comment
Closed

@pytest.mark.usefixtures take no effects on fixtures #378

pytestbot opened this issue Nov 1, 2013 · 1 comment
Labels
type: bug problem that needs to be addressed

Comments

@pytestbot
Copy link
Contributor

Originally reported by: BitBucket: oxyry, GitHub: oxyry


#!python
import pytest

@pytest.fixture
def app(scope='session'):
    print('fixture.app')

@pytest.fixture
def client(app):
    print('fixture.client')

@pytest.fixture
@pytest.mark.usefixtures('client')
def user_tom():
    print('user jessie')

def test_a(user_tom):
    print('test_a')
    assert False

In above code, 'client' fixture does not run, but it runs if put 'client' into user_tom()'s args list.


@pytestbot
Copy link
Contributor Author

Original comment by holger krekel (BitBucket: hpk42, GitHub: hpk42):


usefixtures (and other markers like parametrize for that matter) are not advertised to work on fixture functions, only on test functions. I don't see the advantage of providing usefixtures on a fixture function, in particular.

If you like to see marker support on fixture functions, please open an enhancement issue and provide some ideas/input on the semantics on that. thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: bug problem that needs to be addressed
Projects
None yet
Development

No branches or pull requests

1 participant