8000 bpo-26467: Adds AsyncMock for asyncio Mock library support by lisroach · Pull Request #9296 · python/cpython · GitHub
[go: up one dir, main page]

Skip to content

bpo-26467: Adds AsyncMock for asyncio Mock library support #9296

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

Merged
merged 27 commits into from
May 20, 2019
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
4353041
Initial commmit adding asyncio mock support.
lisroach May 14, 2018
b83e5a5
Adding async support to the mock library.
lisroach Jul 22, 2018
a9ea983
Removes superfluous changes.
lisroach Aug 16, 2018
50581e3
Cleans up comments.
lisroach Aug 16, 2018
96ddb0e
Fixes inspect and attribute error issues.
lisroach Sep 10, 2018
a4d4dbc
Fixes test_unittest changing env because of version issue.
lisroach Sep 11, 2018
bfdd5a7
Removes newlines from inspect.
lisroach Sep 12, 2018
ed7f13c
Removes unneeded comment and newlines.
lisroach Sep 12, 2018
34fa74e
Fixes async tests. Removes inspect fix.
lisroach Sep 14, 2018
302ef64
Fixes environment test issue.
lisroach Sep 14, 2018
bf749ac
Adds argument tests.
lisroach Sep 14, 2018
30b64b5
Adding the side_effect exception test.
lisroach Sep 14, 2018
5edac2a
Changes CoroutineMock to AsyncMock. Removes old-style coroutine refer…
lisroach May 7, 2019
fa978cc
Merge branch 'master' into asyncio_mock
lisroach May 7, 2019
24920a6
Changes fnmatch to list comp.
lisroach May 7, 2019
aec3153
Fixes import and a rebase.
lisroach May 7, 2019
45dddb7
Merge branch 'master' of https://github.com/python/cpython into async…
lisroach May 7, 2019
c0a88a9
Updates news with AsyncMock name change.
lisroach May 7, 2019
f9bee6e
Removes extraneous comments.
lisroach May 7, 2019
81ad0d1
Fixes RunTime warnings and missing io import.
lisroach May 8, 2019
c260104
Changes check to use issubclass instead of !=.
lisroach May 8, 2019
ae13db1
Adds AsyncMock docs and tests for iterators and context managers.
lisroach May 13, 2019
68dff1b
Uncomments commented out test.
lisroach May 13, 2019
64301e2
Fixes based on comments.
lisroach May 17, 2019
c7cd95e
Fixes broken docs.
lisroach May 17, 2019
033f7d3
Fixes broken doc await_arg.
lisroach May 18, 2019
2fef02c
Adds shoutout to Martin Richard for asynctest.
lisroach May 18, 2019
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8000
Prev Previous commit
Next Next commit
Adding async support to the mock library.
  • Loading branch information
lisroach committed Sep 12, 2018
commit b83e5a5a7b3facbf5c9aa31d4dc94e6f1ad34a0c
10 changes: 8 additions & 2 deletions Lib/inspect.py
Original file line number Diff line number Diff line change
Expand Up @@ -176,13 +176,19 @@ def isgeneratorfunction(object):
return bool((isfunction(object) or ismethod(object)) and
object.__code__.co_flags & CO_GENERATOR)


#### LISA this should be in another commit
def iscoroutinefunction(object):
"""Return true if the object is a coroutine function.

Coroutine functions are defined with "async def" syntax.
"""
return bool((isfunction(object) or ismethod(object)) and
object.__code__.co_flags & CO_COROUTINE)
try:
return bool((isfunction(object) or ismethod(object)) and
object.__code__.co_flags & CO_COROUTINE)
except AttributeError:
pass # FIXME


def isasyncgenfunction(object):
"""Return true if the object is an asynchronous generator function.
Expand Down
Loading
0