New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
version 4.0 #476
version 4.0 #476
Conversation
This comment has been minimized.
This comment has been minimized.
try: | ||
from asyncio import run | ||
except ImportError: | ||
def run(main): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Returning the value will help in fixing some of the cases :
def run(main):
loop = asyncio.new_event_loop()
return_value = loop.run_until_complete(main)
loop.close()
return return_value
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yep, that got them all!
Questions :
Thank you very much Chris for this effort :) |
I've started from the revision in ce5b696, it's also stored in lastsync.txt in the repo (the backporting instructions in the docs and The reason for this is that it's the revision before the problematic positional-only argument commit. As we discussed by email, my plan is to skip that patch and the use Only DeprecationWarnings are hidden: https://github.com/testing-cabal/mock/blob/master/setup.cfg#L54 - so all others should be visible in the test run output. I'd suggest waiting until I've got up to current cpython |
Thanks for the details. Sure, I will be happy to help :) |
It's interesting to see what's missing coverage: |
@lisroach - can you talk me through the change in python/cpython@f1a297a as it causes the following failure on Py3.6 when backported:
|
My upstream PR helps with code coverage for |
@cjw296 thanks for doing all of this work! I think that test failure is because the We can update upstream to be backwards compatible here, maybe we need to pull in the |
…ntax for positional-only parameters would limit this codebase to being Py3.8+ only.
…mock (GH-16784) Backports: 66b00a9d3aacf6ed49412f48743e4913104a2bb3 Signed-off-by: Chris Withers <chris@withers.org>
…H-18116) Backports: 62865f4532094017a9b780b704686ca9734bc329 Signed-off-by: Chris Withers <chris@withers.org>
…(GH-15521) Backports: 40c080934b3d49311209b1cb690c2ea1e04df7e7 Signed-off-by: Chris Withers <chris@withers.org>
Backports: aef7dc89879d099dc704bd8037b8a7686fb72838 Signed-off-by: Chris Withers <chris@withers.org>
…gicMock (#16029) Backports: 72b1004657e60c900e4cd031b2635b587f4b280e Signed-off-by: Chris Withers <chris@withers.org>
- The gc.collect is needed for other implementations, such as pypy - Using context managers over multiple lines will only catch the warning from the first line in the context! - remove a skip for a test that no longer fails on pypy Backports: a46575a8f2ded8b49e26c25bb67192e1500e76ca Signed-off-by: Chris Withers <chris@withers.org>
Replace check for whether something is a method in the mock module. The previous version fails on PyPy, because there no method wrappers exist (everything looks like a regular Python-defined function). Thus the isinstance(getattr(result, '__get__', None), MethodWrapperTypes) check returns True for any descriptor, not just methods. This condition could also return erroneously True in CPython for C-defined descriptors. Instead to decide whether something is a method, just check directly whether it's a function defined on the class. This passes all tests on CPython and fixes the bug on PyPy. Backports: a327677905956ae0b239ff430a1346dfe265709e Signed-off-by: Chris Withers <chris@withers.org>
* 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. Backports: db5e86adbce12350c26e7ffc2c6673369971a2dc Signed-off-by: Chris Withers <chris@withers.org>
…attr__ chaining so that call() can be subscriptable (GH-15565) * bpo-37972: unittest.mock._Call now passes on __getitem__ to the __getattr__ chaining so that call() can be subscriptable * 📜🤖 Added by blurb_it. * Update 2019-08-28-21-40-12.bpo-37972.kP-n4L.rst added name of the contributor * bpo-37972: made all dunder methods chainable for _Call * bpo-37972: delegate only attributes of tuple instead to __getattr__ Backports: 72c359912d36705a94fca8b63d80451905a14ae4 Signed-off-by: Chris Withers <chris@withers.org>
Yep, screwed up backporting on 72c359912d36705a94fca8b63d80451905a14ae4 / GH-15565 so redoing. |
No description provided.