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

Parametrized fixture support? #10

Open
proofit404 opened this issue Oct 8, 2020 · 3 comments
Open

Parametrized fixture support? #10

proofit404 opened this issue Oct 8, 2020 · 3 comments

Comments

@proofit404
Copy link

Hi thanks for the project,

I would like to give it a try in my open source projects.

I tend to use parametrized fixtures in it. For example, https://github.com/proofit404/stories/blob/100755889b5478ee211852b78b8167a490e187c2/tests/helpers/examples/__init__.py#L41-L43

I saw parametrized decorator support already existed in the hammett.

Maybe it would be relatively simple to add parametrization to fixtures?

I could try to provide a pull request for it if you want this feature to be in the project.

Have a wonderful day 🌴

Best regards,
Artem.

@boxed
Copy link
Owner

boxed commented Oct 8, 2020

I do want this feature yes. I think I looked at it once and gave up because I didn't have the time just then. But since then I rebuilt the fixture injection code, so it might be easier now.

I would love a PR. Especially some good comprehensive tests, like parametrized fixtures for one test, and then two parametrized fixtures that combine on one test, and a test to check that they combine properly with a parametrized test. I guess that's most of the gnarly cases...

@proofit404
Copy link
Author

I would try to lean the code base at first to understand the steps I need to take for the pull request.

Do you have any suggestions before I start?

@boxed
Copy link
Owner

boxed commented Oct 8, 2020

Nothing super helpful. I have a short memory so I feel a bit like I'm learning the code base every time I go into it :P

There are some places that seem good to start though:

https://github.com/boxed/hammett/blob/master/hammett/impl.py#L72
https://github.com/boxed/hammett/blob/master/hammett/impl.py#L133
https://github.com/boxed/hammett/blob/master/hammett/impl.py#L163
https://github.com/boxed/hammett/blob/master/hammett/impl.py#L195

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