kedder / ofxstatement

Tool to convert proprietary bank statement to OFX format, suitable for importing to GnuCash or other personal finance applications.
GNU General Public License v3.0
270 stars 61 forks source link

prefer the new unittest.mock from the standard library #297

Closed a-detiste closed 1 month ago

a-detiste commented 1 month ago

https://github.com/testing-cabal/mock

mock is now part of the Python standard library, available as unittest.mock in Python 3.3 onwards.

a-detiste commented 1 month ago

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 https://github.com/kedder/ofxstatement/pull/297#discussion_r1633213484:

@@ -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 https://github.com/kedder/ofxstatement/pull/297#pullrequestreview-2107737864, or unsubscribe https://github.com/notifications/unsubscribe-auth/AB47WUELUZ2U5HZ6ABFNIWDZGWPX7AVCNFSM6AAAAABJBG5GSWVHI2DSMVQWIX3LMV43YUDVNRWFEZLROVSXG5CSMV3GSZLXHMZDCMBXG4ZTOOBWGQ . You are receiving this because you authored the thread.Message ID: @.***>

kedder commented 1 month ago

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)

a-detiste commented 1 month ago

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: @.***>

kedder commented 1 month ago

Thank you!

coveralls commented 1 month ago

Coverage Status

coverage: 96.05%. remained the same when pulling 01bc897e51538995c7afd67701ae8b8759b9ac31 on a-detiste:master into 225075416c6a4f4bd9a1dd8b802e81f88dafb40e on kedder:master.