Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/pytest-dev/pytest
/ is_generator
Function
is_generator
src/_pytest/compat.py:63–65 ·
view source on GitHub ↗
(func: object)
Source
from the content-addressed store, hash-verified
61
62
63
def
is_generator(func: object) -> bool:
64
genfunc = inspect.isgeneratorfunction(func)
65
return
genfunc and not iscoroutinefunction(func)
66
67
68
def
iscoroutinefunction(func: object) -> bool:
Callers
3
pytest_pycollect_makeitem
Function · 0.90
call_fixture_func
Function · 0.90
test_is_generator
Function · 0.90
Calls
1
iscoroutinefunction
Function · 0.85
Tested by
1
test_is_generator
Function · 0.72