PyCQA / isort

A Python utility / library to sort imports.
https://pycqa.github.io/isort/
MIT License
6.53k stars 583 forks source link

Fix assertions in `test_git_hook` #2196

Closed mgorny closed 11 months ago

mgorny commented 1 year ago

Fix called_once() assertions in test_git_hook to use the correct assert_called_once() method. The former does not exist, so it evaluates to a mocked method in Python < 3.12, making the assert meaningless, and it triggers an error in Python 3.12+.

While at it, split the mock into two because otherwise the test would fail because two hooks.git_hook() calls imply two mock calls.

codecov[bot] commented 1 year ago

Codecov Report

Merging #2196 (abfb91f) into main (14d0b36) will not change coverage. The diff coverage is n/a.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #2196 +/- ## ======================================= Coverage 99.22% 99.22% ======================================= Files 38 38 Lines 3087 3087 Branches 747 747 ======================================= Hits 3063 3063 Misses 14 14 Partials 10 10 ```
mgorny commented 11 months ago

Thanks!