cpython/Lib/unittest/test/testmock
Chris Withers db5e86adbc
Get mock coverage back to 100% (GH-18228)
* use the `: pass` and `: yield` patterns for code that isn't expected to ever be executed.

* The _Call items passed to _AnyComparer are only ever of length two, so assert instead of if/else

* fix typo

* Fix bug, where stop-without-start patching dict blows up with `TypeError: 'NoneType' object is not iterable`, highlighted by lack of coverage of an except branch.

* The fix for bpo-37972 means _Call.count and _Call.index are no longer needed.

* add coverage for calling next() on a mock_open with readline.return_value set.

* __aiter__ is defined on the Mock so the one on _AsyncIterator is never called.
2020-01-29 16:24:54 +00:00
..
__init__.py
__main__.py
support.py Mock 100% coverage (GH-13045) 2019-05-01 23:04:04 +01:00
testasync.py Get mock coverage back to 100% (GH-18228) 2020-01-29 16:24:54 +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 Get mock coverage back to 100% (GH-18228) 2020-01-29 16:24:54 +00:00
testpatch.py Get mock coverage back to 100% (GH-18228) 2020-01-29 16:24:54 +00: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