-
Notifications
You must be signed in to change notification settings - Fork 61
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
prefer the new unittest.mock from the standard library #297
Conversation
try: | ||
from unittest import mock | ||
except ImportError: | ||
import mock |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We don't support the ancient versions of Python, so I think this precaution is unnecessary (unless I'm missing something).
Hi,
The baseline is not explicitly documented.
So yes a plain "from unittest import mock" would be enough in modern system.
Le lun. 10 juin 2024 à 15:02, Andrey Lebedev ***@***.***> a
écrit :
… ***@***.**** commented on this pull request.
------------------------------
In src/ofxstatement/tests/test_plugin.py
<#297 (comment)>:
> @@ -1,6 +1,9 @@
import unittest
-import mock
+try:
+ from unittest import mock
+except ImportError:
+ import mock
We don't support the ancient versions of Python, so I think this
precaution is unnecessary (unless I'm missing something).
—
Reply to this email directly, view it on GitHub
<#297 (review)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AB47WUELUZ2U5HZ6ABFNIWDZGWPX7AVCNFSM6AAAAABJBG5GSWVHI2DSMVQWIX3LMV43YUDVNRWFEZLROVSXG5CSMV3GSZLXHMZDCMBXG4ZTOOBWGQ>
.
You are receiving this because you authored the thread.Message ID:
***@***.***>
|
It is somewhat documented in pyproject.toml: Line 13 in 2250754
I think we can assume it is not running on earlier pythons (and it probably won't for a lot of other reasons) |
Good catch. I didn't noticed.
3.9 is plenty enough.
"mock" is fully fossilizied since 3.6
Le lun. 10 juin 2024 à 15:13, Andrey Lebedev
***@***.***> a écrit :
…
It is somewhat documented in pyproject.toml: https://github.com/kedder/ofxstatement/blob/225075416c6a4f4bd9a1dd8b802e81f88dafb40e/pyproject.toml#L13
I think we can assume it is not running on earlier pythons (and it probably won't for a lot of other reasons)
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you authored the thread.Message ID: ***@***.***>
|
Thank you! |
https://github.com/testing-cabal/mock
mock is now part of the Python standard library, available as unittest.mock in Python 3.3 onwards.