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 fixtures and pytest.mark.parametrize with gen_cluster #4958

Merged
merged 4 commits into from
Jun 23, 2021

Conversation

gjoseph92
Copy link
Collaborator

I've often wanted to @pytest.mark.parametrize tests that use @gen_cluster. The current pattern is to define the main testing logic in a closure within the outer parametrized function (example). This works okay, but it's a little unintuitive. By altering the signature of the wrapped function, we can make it play nicely with pytest.

Related to #3540 (if that weren't already closed, I'd say this closes it).

  • Tests added / passed
  • Passes black distributed / flake8 distributed / isort distributed

Copy link
Member

@fjetter fjetter left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for looking into this! I was a bit hesitant to patch the signature but if it works, I don't mind!

@fjetter
Copy link
Member

fjetter commented Jun 23, 2021

Test failure seems to be unrelated. Thanks @gjoseph92

@fjetter fjetter merged commit 9f4165a into dask:main Jun 23, 2021
@mrocklin
Copy link
Member

Ooh, nice.

fjetter pushed a commit to fjetter/distributed that referenced this pull request Jun 23, 2021
…sk#4958)

Support fixtures and `pytest.mark.parametrize` with `gen_cluster` (dask#4958)
@fjetter fjetter mentioned this pull request Jun 28, 2021
3 tasks
@gjoseph92 gjoseph92 deleted the gen_cluster/parametrize branch June 28, 2021 16:36
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.

3 participants