-
Notifications
You must be signed in to change notification settings - Fork 269
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
How to use Ignore packages #420
Comments
This also impacting |
@lucemia I found a potential bug of freezegun that causes the issue for Google API: For the google library, it uses The temporary fix is to monkey patch freezegun as follow: def monkey_patch_freezegun_for_google_api():
import freezegun
def utcnow():
if freezegun.api._should_use_real_time():
result = freezegun.api.real_datetime.utcnow()
else:
result = freezegun.api.FakeDatetime._time_to_freeze()
return freezegun.api.datetime_to_fakedatetime(result)
freezegun.configure(
extend_ignore_list=[
"google",
]
)
setattr(freezegun.api.FakeDatetime, "utcnow", utcnow)
monkey_patch_freezegun_for_google_api() |
Also, for snowflake connector, freezegun breaks the OCSP validation, and so far the solution is to use the from snowflake.connector.connection import DEFAULT_CONFIGURATION
DEFAULT_CONFIGURATION["insecure_mode"] = (True, bool) |
Thanks for the patch @ale-hm - it helped. Had exception: |
While I use freezegun with google storage api, I got the following error.
google.auth.exceptions.RefreshError: ('invalid_grant: Invalid JWT: Token must be a short-lived token (60 minutes) and in a reasonable timeframe. Check your iat and exp values in the JWT claim.', {'error': 'invalid_grant', 'error_description': 'Invalid JWT: Token must be a short-lived token (60 minutes) and in a reasonable timeframe. Check your iat and exp values in the JWT claim.'})
I think ignore packages may solve the problem. Ref: #185
I tried add ["google", "google.auth", "google.cloud"] in ignore list, but still got the same error.
I am confused about how to use Ignore Packages correctly.
For example:
whether I add urllib3 to ignore list or not,
it will still raise
SystemTimeWarning: System time is way off (before 2020-07-01). This will probably lead to SSL verification errors
The text was updated successfully, but these errors were encountered: