MCPcopy 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
63def is_generator(func: object) -> bool:
64 genfunc = inspect.isgeneratorfunction(func)
65 return genfunc and not iscoroutinefunction(func)
66
67
68def iscoroutinefunction(func: object) -> bool:

Callers 3

call_fixture_funcFunction · 0.90
test_is_generatorFunction · 0.90

Calls 1

iscoroutinefunctionFunction · 0.85

Tested by 1

test_is_generatorFunction · 0.72