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 patron expiration test #1443

Merged
merged 4 commits into from
Jun 12, 2020

Conversation

tdilauro
Copy link
Collaborator

Description

This branch fixes a couple of tests that used the wrong time zone for patron expiration date/time values.

Motivation and Context

Depending on local time zone and time of day when run, the affected tests might or might not fail. The tests in question were using UTC time for patron expiration, but the PatronUtility.authorization_is_active uses server local time.

Fixes #741

How Has This Been Tested?

Successfully ran the remediated tests late night EDT, when they were originally failing, and mid-morning EDT when they previously were NOT failing.

TESTING=true PYTHONWARNINGS=ignore nosetests -w tests \
  test_patron_utility.py:TestPatronUtility.test_has_borrowing_privileges \
  test_patron_utility.py:TestPatronUtility.test_needs_external_sync

Checklist:

  • I have updated the documentation accordingly.
  • All new and existing tests passed.

@tdilauro tdilauro marked this pull request as ready for review June 12, 2020 01:55
@tdilauro tdilauro requested a review from leonardr June 12, 2020 01:59
@tdilauro
Copy link
Collaborator Author

Any idea why sphinx is erroring in Travis? It's working fine in my local environment.

@leonardr
Copy link
Contributor

There was a release of the rsa package 18 hours ago, which silently dropped Python 2 support. This is the same thing that happened recently to NLTK. You can fix it by pinning rsa to "<4.1" in requirements.txt.

@leonardr
Copy link
Contributor

Copy link
Contributor

@leonardr leonardr left a comment

Choose a reason for hiding this comment

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

The code itself looks good; you just drew the requirements.txt short straw.

@tdilauro
Copy link
Collaborator Author

Thanks, @leonardr. All set.

@leonardr leonardr merged commit bffef19 into NYPL-Simplified:master Jun 12, 2020
@sybrenstuvel
Copy link

I fixed it in the Python-RSA package so that package managers now know which version they can use. Python-RSA 4.3 is now the last one to support Python 2.7, version 4.4 explicitly requires Python 3.5+.

Hope this is now resolved for you, if there are still issues let me know.

@leonardr
Copy link
Contributor

Thanks, Sybren, we appreciate it.

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.

Some tests in test_patron_utility.py fail when run at certain times
3 participants