cpython/Lib/unittest/test/testmock
vabr-g 4662fa9bfe
bpo-41877 Check for asert, aseert, assrt in mocks (GH-23165)
Currently, a Mock object which is not unsafe will raise an
AttributeError if an attribute with the prefix assert or assret is
accessed on it. This protects against misspellings of real assert
method calls, which lead to tests passing silently even if the tested
code does not satisfy the intended assertion.

Recently a check was done in a large code base (Google) and three
more frequent ways of misspelling assert were found causing harm:
asert, aseert, assrt. These are now added to the existing check.
2020-11-05 09:04:38 -08:00
..
__init__.py
__main__.py Adjust comment 2013-09-14 00:40:46 +02:00
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 asert, aseert, assrt in mocks (GH-23165) 2020-11-05 09:04:38 -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