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

Improve tests/subtests #163

Merged
merged 8 commits into from
Jun 14, 2022
Merged

Conversation

ConorMacBride
Copy link
Member

@ConorMacBride ConorMacBride commented May 27, 2022

Now the tests/subtests can be updated/regenerated automatically without needing to manually adjust the baseline data.

To create the baseline images and hashes run:

MPL_UPDATE_BASELINE=1 tox -e mpl35

Then, to create the baseline summaries run:

MPL_UPDATE_SUMMARY=1 tox -e mpl35

Finally check the git diff and run the standard tests before committing:

tox -e mpl35

I will add documentation for this in a README file in tests/subtests.

All changes are isolated to within tests/subtests except I've added Pillow (imported as PIL) as a dependency. (Matplotlib already requires this package and #150 will need it also.) And I have made some minor changes to tox.ini.

Interestingly, removing the matplotlib version number from the PNGs means that all the hashes are identical across matplotlib 3.3, 3.4 and 3.5!! (I guess this isn't too surprising since the plots are very basic.)

  • Add documentation

Closes #159

@bjlittle bjlittle mentioned this pull request May 28, 2022
16 tasks
@ConorMacBride ConorMacBride marked this pull request as ready for review May 28, 2022 16:45
os.path.realpath(tempfile.gettempdir()), # replace all references to output files
]
REGEX_STRS = [
r'RMS Value: ',
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@bjlittle, in #150 this will need changed to r'RMS: '.

tests/subtests/README.rst Outdated Show resolved Hide resolved
tests/subtests/README.rst Outdated Show resolved Hide resolved
Copy link
Contributor

@bjlittle bjlittle left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@ConorMacBride Lovely. Looking forward to using this straight away for #150 👍

Co-authored-by: Bill Little <bill.little@metoffice.gov.uk>
@ConorMacBride
Copy link
Member Author

pre-commit.ci autofix

@Cadair Cadair merged commit 1c58479 into matplotlib:main Jun 14, 2022
@ConorMacBride ConorMacBride deleted the improve-subtests branch February 28, 2023 19:18
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

Successfully merging this pull request may close these issues.

Reinstate sub-tests
3 participants