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

Make test_change_epoch more robust. #20817

Merged
merged 1 commit into from Aug 10, 2021

Conversation

QuLogic
Copy link
Member

@QuLogic QuLogic commented Aug 10, 2021

PR Summary

The epoch is set by explicitly calling mdates.set_epoch, or implicitly set to the default by mdates.get_epoch (which is also called when converting datetimes.)

However, when running tests in parallel, there is no guarantee that any other call to [gs]et_epoch might have been made to lock it in, so we need to do that explicitly.

PR Checklist

  • Has pytest style unit tests (and pytest passes).
  • Is Flake 8 compliant (run flake8 on changed files to check).
  • [n/a] New features are documented, with examples if plot related.
  • [n/a] Documentation is sphinx and numpydoc compliant (the docs should build without error).
  • Conforms to Matplotlib style conventions (install flake8-docstrings and run flake8 --docstring-convention=all).
  • [n/a] New features have an entry in doc/users/next_whats_new/ (follow instructions in README.rst there).
  • [n/a] API changes documented in doc/api/next_api_changes/ (follow instructions in README.rst there).

The epoch is set by explicitly calling `mdates.set_epoch`, or implicitly
set to the default by `mdates.get_epoch` (which is also called when
converting datetimes.)

However, when running tests in parallel, there is no guarantee that any
other call to `[gs]et_epoch` might have been made to lock it in, so we
need to do that explicitly.
Copy link
Member

@jklymak jklymak left a comment

Choose a reason for hiding this comment

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

Not sure you need the first get_epoch

@QuLogic
Copy link
Member Author

QuLogic commented Aug 10, 2021

Not sure you need the first get_epoch

But that's the point; it wouldn't be locked in and raise without it.

@timhoffm timhoffm merged commit 3d5027d into matplotlib:master Aug 10, 2021
meeseeksmachine pushed a commit to meeseeksmachine/matplotlib that referenced this pull request Aug 10, 2021
@QuLogic QuLogic deleted the robust-change-epoch branch August 10, 2021 22:01
QuLogic added a commit that referenced this pull request Aug 10, 2021
…817-on-v3.4.x

Backport PR #20817 on branch v3.4.x (Make test_change_epoch more robust.)
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

3 participants