[issue40133] Provide additional matchers for unittest.mock

Diego Elio Pettenò report at bugs.python.org
Wed Apr 1 06:00:05 EDT 2020


New submission from Diego Elio Pettenò <flameeyes at flameeyes.com>:

The unittest.mock `assert_called_*with*` methods take either literals, or the single `ANY` special matcher (https://docs.python.org/3/library/unittest.mock.html#any) to match any argument.

Experience suggests me that it's useful to have more flexible matchers, such as INSTANCEOF or REGEXP.

Will provide a starting pull request for this today. (Be warned: it's the first time I try contributing to CPython.)

----------
components: Tests
messages: 365457
nosy: Diego Elio Pettenò
priority: normal
severity: normal
status: open
title: Provide additional matchers for unittest.mock
type: enhancement
versions: Python 3.9

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue40133>
_______________________________________


More information about the Python-bugs-list mailing list