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

Support no-call async_fixture and async_yield_fixture to align with pytest.fixture #79

Open
cdunklau opened this issue Feb 18, 2020 · 0 comments

Comments

@cdunklau
Copy link
Collaborator

Currently, you must call pytest_twisted.async_fixture and pytest_twisted.async_yield_fixture, and (until #74 fixes it) the readme demonstrates no-call semantics. I propose allowing this form by mimicking pytest.fixtures's behavior, to improve consistency and UX.

It looks like pytest.fixture treats its first argument as either the fixture scope name if it's a str, and otherwise assumes it's the fixture function:

https://github.com/pytest-dev/pytest/blob/fd1a51a23fa687cf344f3506dff6cde0166faf2c/src/_pytest/fixtures.py#L1029-L1068

At first glance, I think this is a reasonable approach, and should be relatively straightforward to implement.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant