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

fixtures: remove special cases when deciding when pytest.fixture() is a direct decoration #7253

Merged
merged 1 commit into from
Jun 5, 2020

Commits on May 26, 2020

  1. fixtures: remove special cases when deciding when pytest.fixture() is…

    … a direct decoration
    
    pytest.fixture() can be used either as
    
        @pytest.fixture
        def func(): ...
    
    or as
    
        @pytest.fixture()
        def func(): ...
    
    or (while maybe not intended)
    
        func = pytest.fixture(func)
    
    so it needs to inspect internally whether it got a function in the first
    positional argument or not.
    
    Previously, there were was oddity. In the following,
    
        func = pytest.fixture(func, autouse=True)
        # OR
        func = pytest.fixture(func, parms=['a', 'b'])
    
    The result is as if `func` wasn't passed.
    
    There isn't any reason for this special that I can understand, so remove
    it.
    bluetech committed May 26, 2020
    Configuration menu
    Copy the full SHA
    5507752 View commit details
    Browse the repository at this point in the history