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

Feature request - making custom tests interoperable with @pytest.mark.parametrize #196

Open
theJasonFan opened this issue May 7, 2024 · 2 comments

Comments

@theJasonFan
Copy link

Thanks for the great tool. How much work would it take to make custom pytest-workflow tests to play nice with @pytest.mark.parametrize?

I believe that tests that use and are annotated by @pytest.mark.parametrize and pytest workflow's @pytest.mark.workflow will always be skipped if @pytest.mark.workflow marks the test for multiple workflows. I.e.

  • A custom test for multiple workflows with no parametrization is ok.
  • A custom test for a single workflow with parametrization is ok.
  • A custom test for multiple workflows with parametrization is not ok and is always skipped

Would this be a reasonable feature request? If there is a reasonably straightforward solution, I would not mind taking a crack at it with some input and guidance from maintainers here.

Thanks!

@rhpvorderman
Copy link
Member

How much work would it take to make custom pytest-workflow tests to play nice with @pytest.mark.parametrize?

That's not a use case we have, so I cannot justify putting quite a lot of time in it. Most of the time will be getting into the details of the pytest API.

Would this be a reasonable feature request? If there is a reasonably straightforward solution, I would not mind taking a crack at it with some input and guidance from maintainers here.

By all means!
It looks like there is already parametrization going on with the workflow mark itself in this function: https://github.com/LUMC/pytest-workflow/blob/develop/src/pytest_workflow/plugin.py#L211.
You could check out how it works and fix it to work properly with other parametrized tests.

@theJasonFan
Copy link
Author

That's not a use case we have, so I cannot justify putting quite a lot of time in it. Most of the time will be getting into the details of the pytest API.

Totally fair. No guarantees from my side either. I will update if I end up giving this a shot!

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

2 participants