Browse Source
Get mock coverage back to 100% (GH-18228)
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.pull/18258/head
committed by
GitHub
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 35 additions and 54 deletions
-
17Lib/unittest/mock.py
-
59Lib/unittest/test/testmock/testasync.py
-
5Lib/unittest/test/testmock/testmock.py
-
8Lib/unittest/test/testmock/testpatch.py
Write
Preview
Loading…
Cancel
Save
Reference in new issue