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

r.info: migrate to pytest #5460

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open

Conversation

kritibirda26
Copy link
Contributor

Create the required sample data, pytest fixtures and migrate r.info module from gunittest to pytest.

Create the required sample data, pytest fixtures and migrate
r.info module from gunittest to pytest.
@kritibirda26 kritibirda26 changed the title Migrate r.info to pytest r.info: migrate to pytest Mar 27, 2025
@echoix
Copy link
Member

echoix commented Mar 27, 2025

For a single fixture used by a single file, placing it in a conftest.py file, that isn't reused anywhere else, I think it is only hiding the magic pytest does (the conftest isn't directly imported by us) and readers/reviewers need to remember to go see another file.

So, to replace a series of setUpClass/setUp, using fixtures defined in the same test file seems more efficient.

What do others think?

I didn't really start looking at the conversion itself

@github-actions github-actions bot added raster Related to raster data processing Python Related code is in Python module tests Related to Test Suite labels Mar 27, 2025
@kritibirda26
Copy link
Contributor Author

The existing pytest tests are currently using per module conftest.py so I added it as a separate file in this case too. I think for now it would be fine even if we moved the fixtures to the test file itself.

But in the future, when I have more understanding of the test requirements of various modules, I would like to factor common fixtures to a higher level to reduce code duplication.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
module Python Related code is in Python raster Related to raster data processing tests Related to Test Suite
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants