cpython/Lib/unittest/test/testmock
vabr-g fdb9efce6a
bpo-41877: Check for misspelled speccing arguments (GH-23737)
patch, patch.object and create_autospec silently ignore misspelled
arguments such as autospect, auto_spec and set_spec. This can lead
to tests failing to check what they are supposed to check.

This change adds a check causing a RuntimeError if the above
functions get any of the above misspellings as arguments. It also
adds a new argument, "unsafe", which can be set to True to disable
this check.

Also add "!r" to format specifiers in added error messages.
2020-12-14 10:30:09 -08:00
..
__init__.py
__main__.py
support.py Mock 100% coverage (GH-13045) 2019-05-01 23:04:04 +01:00
testasync.py bpo-39915: Ensure await_args_list is updated according to the order in which coroutines were awaited (GH-18924) 2020-03-11 15:06:12 +00:00
testcallable.py Mock 100% coverage (GH-13045) 2019-05-01 23:04:04 +01:00
testhelpers.py bpo-37555: Update _CallList.__contains__ to respect ANY (#14700) 2019-09-13 16:54:32 +01:00
testmagicmethods.py Clarify and fix assertions that mocks have not been awaited (GH-18196) 2020-01-27 14:55:56 +00:00
testmock.py bpo-41877: Check for misspelled speccing arguments (GH-23737) 2020-12-14 10:30:09 -08:00
testpatch.py bpo-40126: Fix reverting multiple patches in unittest.mock. (GH-19351) 2020-04-11 10:59:24 +03:00
testsealable.py Mock 100% coverage (GH-13045) 2019-05-01 23:04:04 +01:00
testsentinel.py Issue #20804: The unittest.mock.sentinel attributes now preserve their 2017-01-11 20:13:03 +02:00
testwith.py bpo-37008: make mock_open handle able to honor next() (GH-13492) 2019-05-23 03:03:25 -07:00