This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author vabr2
Recipients vabr2
Date 2020-09-28.18:19:17
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1601317157.88.0.730935461305.issue41877@roundup.psfhosted.org>
In-reply-to
Content
Recently we cleaned up the following typos in mocks in unittests of our codebase:

* Wrong prefixes of mock asserts: asert/aseert/assrt -> assert
* Wrong attribute names around asserts: autospect/auto_spec -> autospec, set_spec -> spec_set

Especially the asserts are dangerous, because a misspelled assert_called will fail silently. We found real bugs in production code which were masked by a misspelled assert_called.

There is prior work done to report similar cases of assert misspellings with an AttributeError: https://github.com/testing-cabal/mock/commit/7c530f0d9aa48d2538501761098df7a5a8979a7d, and adding new cases will be an easy change. I suppose that adding similar error signalling for the wrong argument names will not be much harder.

I'm prepared to implement it, if people of this project would be happy to have such checks.
History
Date User Action Args
2020-09-28 18:19:17vabr2setrecipients: + vabr2
2020-09-28 18:19:17vabr2setmessageid: <1601317157.88.0.730935461305.issue41877@roundup.psfhosted.org>
2020-09-28 18:19:17vabr2linkissue41877 messages
2020-09-28 18:19:17vabr2create