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

plugin: add mh_fixture #57

Merged
merged 1 commit into from
Jun 3, 2024
Merged

Conversation

pbrezina
Copy link
Contributor

It is not possible to access topology fixtures from pytest fixture.
This adds a wrapper to workaround that.

@mh_fixture()
def my_fixture(client: Client, request: pytest.FixtureRequest):
    pass

@pytest.mark.topology(KnownTopology.LDAP)
def test_example(client: Client, ldap: LDAP, my_fixture):
    pass

@pbrezina
Copy link
Contributor Author

I opened pytest-dev/pytest#12376 to be able to avoid this workaround. But for the moment, this seems to be the only option.

It is not possible to access topology fixtures from pytest fixture.
This adds a wrapper to workaround that.

```
@mh_fixture()
def my_fixture(client: Client, request: pytest.FixtureRequest):
    pass

@pytest.mark.topology(KnownTopology.LDAP)
def test_example(client: Client, ldap: LDAP, my_fixture):
    pass
```
@pbrezina pbrezina merged commit 53aaf38 into next-actions:master Jun 3, 2024
2 of 4 checks passed
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

Successfully merging this pull request may close these issues.

2 participants