cpython/Lib/unittest
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
..
test bpo-41877 Check for asert, aseert, assrt in mocks (GH-23165) 2020-11-05 09:04:38 -08:00
__init__.py bpo-40275: Avoid importing asyncio in test.support (GH-19600) 2020-04-25 10:04:10 +03:00
__main__.py bpo-29919: Remove unused imports found by pyflakes (#137) 2017-03-27 16:05:26 +02:00
_log.py bpo-41943: Fix bug where assertLogs doesn't correctly filter messages… (GH-22565) 2020-11-02 11:25:29 -08:00
async_case.py bpo-39101: Fixes BaseException hang in IsolatedAsyncioTestCase. (GH-22654) 2020-10-26 09:28:17 -07:00
case.py bpo-39385: Add an assertNoLogs context manager to unittest.TestCase (GH-18067) 2020-07-01 22:08:38 +01:00
loader.py bpo-35767: Fix unittest.loader to allow partials as test_functions (#11600) 2019-01-23 21:57:25 +01:00
main.py bpo-32071: Add unittest -k option (#4496) 2017-11-25 16:23:52 +01:00
mock.py bpo-41877 Check for asert, aseert, assrt in mocks (GH-23165) 2020-11-05 09:04:38 -08:00
result.py Fix typos in comments, docs and test names (#15018) 2019-07-30 18:16:13 -04:00
runner.py bpo-35513, unittest: TextTestRunner uses time.perf_counter() (GH-11180) 2018-12-17 11:30:34 +01:00
signals.py Closes issue 15505. unittest.installHandler and non-callable signal handlers. 2013-01-29 23:07:57 +00:00
suite.py bpo-24412: Adds cleanUps for setUpClass and setUpModule. (GH-9190) 2018-11-08 18:34:33 -08:00
util.py bpo-32360: unittest.util: Use Counter instead of custom count function (GH-4994) 2018-01-24 16:49:58 +09:00