Skip to content

Avoid parametrizing tests with itertools.product() #18110

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

Open
1 of 10 tasks
eerovaher opened this issue May 8, 2025 · 9 comments · May be fixed by #18196
Open
1 of 10 tasks

Avoid parametrizing tests with itertools.product() #18110

eerovaher opened this issue May 8, 2025 · 9 comments · May be fixed by #18196
Labels
good first issue Issues that are well-suited for new contributors Package-novice testing

Comments

@eerovaher
Copy link
Member

eerovaher commented May 8, 2025

There are some parametrized tests that use itertools.product() for generating parametrizations. However, in many cases they could instead use stacked @pytest.mark.parametrize() decorators, which can often be written down using fewer lines and might remove the need to import itertools in the test file.

#18109 is an example of what a pull request addressing this issue might look like.

List of files to update

It might be a good idea to update one sub-package per pull request.

@eerovaher eerovaher added testing Package-novice good first issue Issues that are well-suited for new contributors labels May 8, 2025
@jsdingra11
Copy link

Hi @eerovaher can I help into this, I looked into the issue and the #18109 and I understood how to fix that all!

@jsdingra11
Copy link

jsdingra11 commented May 13, 2025

kindly have a look : #18142

@jch1013
Copy link
Contributor

jch1013 commented May 13, 2025

hi @jsdingra11,
Saw you were working on this - is it ok if I work on the pull request for the last file in the list (astropy/wcs/wcsapi/tests/test_fitswcs.py)? I'm just starting out and there aren't other recent good first issues available. Wanted to check in to see if you've already updated this. thanks for considering!

@jsdingra11
Copy link

jsdingra11 commented May 14, 2025

hi @jsdingra11, Saw you were working on this - is it ok if I work on the pull request for the last file in the list (astropy/wcs/wcsapi/tests/test_fitswcs.py)? I'm just starting out and there aren't other recent good first issues available. Wanted to check in to see if you've already updated this. thanks for considering!

Hi @jch1013,
why not, if you are eager to help why not! I have made a pull request for the first file, lets see if it get approved, then we can do the work 50-50 for this issue!

@jch1013
Copy link
Contributor

jch1013 commented May 15, 2025

hi @jsdingra11, Saw you were working on this - is it ok if I work on the pull request for the last file in the list (astropy/wcs/wcsapi/tests/test_fitswcs.py)? I'm just starting out and there aren't other recent good first issues available. Wanted to check in to see if you've already updated this. thanks for considering!

Hi @jch1013, why not, if you are eager to help why not! I have made a pull request for the first file, lets see if it get approved, then we can do the work 50-50 for this issue!

Thanks! Appreciate it!

@AlexFoxOSU
Copy link

Hi @jch1013 and @jsdingra11, would you mind if I work on a file from this Issue? I'm a first time contributor and would like to start by contributing a simple PR. I was thinking of doing a PR for test_polynomial.py. Thank you!

@jch1013
Copy link
Contributor

jch1013 commented May 29, 2025

@AlexFoxOSU Not at all! FYI, I've got a pull request open for astropy/time/tests/test_methods.py but haven't started any of the others so test_polynomial would be helpful

@AlexFoxOSU
Copy link

@AlexFoxOSU Not at all! FYI, I've got a pull request open for astropy/time/tests/test_methods.py but haven't started any of the others so test_polynomial would be helpful

Awesome! Thank you!

@preshanth
Copy link

@AlexFoxOSU sorry I did not see that you wanted to do polynomials. I did a bunch of these. I have left astropy/convolution/tests/test_convolve_kernels.py if you want to take that up.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Issues that are well-suited for new contributors Package-novice testing
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy