[proxy] web.archive.org← back | site home | direct (HTTPS) ↗ | proxy home | ◑ dark◐ light

Get mock coverage back to 100% by cjw296 · Pull Request #18228 · python/cpython

cjw296

…to ever be exectuted.

The assertion makes sure this continues to be the case!

Before this change, the stop-without-start blows up with `TypeError: 'NoneType' object is not iterable`

… needed.

…alue set.

cjw296 merged commit db5e86a into python:master

Jan 29, 2020

8 checks passed

Azure Pipelines PR #20200128.12 succeeded

Details

bedevere/issue-number Issue report skipped

bedevere/news "skip news" label found

continuous-integration/travis-ci/pr The Travis CI build passed

Details

cjw296 deleted the cjw296:mock_coverage branch

Jan 29, 2020

shihai1991 added a commit to shihai1991/cpython that referenced this pull request

Jan 31, 2020

* 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.