MCPcopy Create free account
hub / github.com/pytest-dev/pytest / test_is_generator_asyncio

Function test_is_generator_asyncio

testing/test_compat.py:94–110  ·  view source on GitHub ↗
(pytester: Pytester)

Source from the content-addressed store, hash-verified

92
93
94def test_is_generator_asyncio(pytester: Pytester) -> None:
95 pytester.makepyfile(
96 """
97 from _pytest.compat import is_generator
98 import asyncio
99 @asyncio.coroutine
100 def baz():
101 yield from [1,2,3]
102
103 def test_is_generator_asyncio():
104 assert not is_generator(baz)
105 """
106 )
107 # avoid importing asyncio into pytest's own process,
108 # which in turn imports logging (#8)
109 result = pytester.runpytest_subprocess()
110 result.stdout.fnmatch_lines(["*1 passed*"])
111
112
113def test_is_generator_async_syntax(pytester: Pytester) -> None:

Callers

nothing calls this directly

Calls 3

fnmatch_linesMethod · 0.80
makepyfileMethod · 0.45
runpytest_subprocessMethod · 0.45

Tested by

no test coverage detected