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

Conditionally patch time.clock #296

Merged
merged 3 commits into from
May 18, 2019
Merged

Conditionally patch time.clock #296

merged 3 commits into from
May 18, 2019

Conversation

pganssle
Copy link
Contributor

time.clock was removed in Python 3.8, which is causing freezegun to fail when importing the API module as it tries to stash and patch the clock function. This makes the patching logic conditional on the existence of a time.clock function.

time.clock has been deprecated for some time, and I guess it was just missed in at least my test suite because the real function was never invoked.

It may be worth hard failing on deprecation warnings in your test suite in the future, to avoid problems like this.

time.clock was removed in Python 3.8, which is causing `freezegun` to
fail when importing the api module as it tries to stash and patch the
clock function.

This makes the patching logic conditional on the existence of a
time.clock function.
@coveralls
Copy link

Coverage Status

Coverage increased (+0.04%) to 93.786% when pulling d10c1aa on pganssle:fix_38 into c2d1dd2 on spulec:master.

2 similar comments
@coveralls
Copy link

Coverage Status

Coverage increased (+0.04%) to 93.786% when pulling d10c1aa on pganssle:fix_38 into c2d1dd2 on spulec:master.

@coveralls
Copy link

Coverage Status

Coverage increased (+0.04%) to 93.786% when pulling d10c1aa on pganssle:fix_38 into c2d1dd2 on spulec:master.

@coveralls
Copy link

coveralls commented May 17, 2019

Coverage Status

Coverage increased (+0.04%) to 93.786% when pulling 35713b8 on pganssle:fix_38 into c2d1dd2 on spulec:master.

@pganssle
Copy link
Contributor Author

Test failure on 3.8-dev seems unrelated, but also is emitting deprecation warnings in time.clock, so evidently whatever version Travis has doesn't have the time.clock removal yet.

@boxed
Copy link
Contributor

boxed commented May 18, 2019

Nice! Thanks.

@boxed boxed merged commit 8fca546 into spulec:master May 18, 2019
@pganssle pganssle deleted the fix_38 branch May 18, 2019 13:16
@pganssle
Copy link
Contributor Author

@boxed Since this is actively breaking on Python 3.8 on import, I think a release sooner rather than later would be a good idea - considering this is a testing library and it may block people from testing 3.8 before the release.

Not sure if you use the publish target in the MakeFile, but if you do I recommend instead using something like #297 for the publishing instead.

@boxed
Copy link
Contributor

boxed commented May 19, 2019

Agreed. But I don't have access to make a release. @spulec

@spulec
Copy link
Owner

spulec commented May 30, 2019

Thanks!

Released with 0.3.12.

@pganssle
Copy link
Contributor Author

@spulec It seems like you used the publish Makefile target without merging #297, because once again you have hit the problem from #268. Given that the release was 14 minutes ago, can you please delete it and cut a new one?

Once PEP 592 is implemented, you will be able to "yank" the last two releases and cut new releases in their place, but you may as well delete the most recent one before someone gets hit by it.

@spulec
Copy link
Owner

spulec commented Jul 1, 2019

Sorry about that. I've merged #296 for the future.

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.

4 participants