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

Function test_is_generator_async_gen_syntax

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

Source from the content-addressed store, hash-verified

130
131
132def test_is_generator_async_gen_syntax(pytester: Pytester) -> None:
133 pytester.makepyfile(
134 """
135 from _pytest.compat import is_generator
136 def test_is_generator_py36():
137 async def foo():
138 yield
139 await foo()
140
141 async def bar():
142 yield
143
144 assert not is_generator(foo)
145 assert not is_generator(bar)
146 """
147 )
148 result = pytester.runpytest()
149 result.stdout.fnmatch_lines(["*1 passed*"])
150
151
152class ErrorsHelper:

Callers

nothing calls this directly

Calls 3

fnmatch_linesMethod · 0.80
makepyfileMethod · 0.45
runpytestMethod · 0.45

Tested by

no test coverage detected