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

Fix the pycoast tests further #86

Merged
merged 1 commit into from
Jan 11, 2023

Conversation

mraspaud
Copy link
Member

This small PR addresses reviewer comments that where omitted in the last test refactoring PR.

@mraspaud mraspaud requested a review from djhoese January 11, 2023 16:24
@mraspaud mraspaud self-assigned this Jan 11, 2023
@coveralls
Copy link

Coverage Status

Coverage: 94.675% (+0.2%) from 94.477% when pulling dedb45c on mraspaud:refactor-pycoast-tests into a37aeec on pytroll:main.

@djhoese
Copy link
Member

djhoese commented Jan 11, 2023

Looks good and the only uncovered code in that file is now the plotting helper stuff and the saving of an image when the test fails. I see that a failed image is saved to tmp_path. Is that useful since that directory will likely be deleted when the tests finish?

I'll merge this and we can make a new PR if we agree on changes to this.

@djhoese djhoese merged commit 59b79bc into pytroll:main Jan 11, 2023
@pnuu
Copy link
Member

pnuu commented Jan 11, 2023

I see that a failed image is saved to tmp_path. Is that useful since that directory will likely be deleted when the tests finish?

In my experience the tmp_path stuff is not deleted after the tests run. For example in pytroll/satpy#2316 (comment) there were 3 consecutive runs that were kept within the temp directory. I didn't yet comment there, but as Martin suggested, the next run finally removed the first one (index 0) and created a new entry.

@djhoese
Copy link
Member

djhoese commented Jan 11, 2023

Ok so we probably still need a print out of the temporary directory on failure so we can easily get to the image.

@mraspaud mraspaud deleted the refactor-pycoast-tests branch January 12, 2023 09:34
@mraspaud
Copy link
Member Author

from https://docs.pytest.org/en/7.1.x/reference/reference.html#pytest.tmpdir.tmp_path :

By default, a new base temporary directory is created each test session, and old bases are removed after 3 sessions, to aid in debugging. If --basetemp is used then it is cleared each session. See The default base temporary directory.

@mraspaud
Copy link
Member Author

so 3 runs are kept.
We can of course print the path, but I think it's pretty easy to find, the /tmp/pytest... structure is clear I think.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants