MCPcopy Index your code
hub / github.com/ipython/ipython / test_in_func_no_error

Method test_in_func_no_error

tests/test_async_helpers.py:256–360  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

254 iprc(test_case.format(val=val))
255
256 def test_in_func_no_error(self):
257 # Test that the implementation of top-level return/yield
258 # detection isn't *too* aggressive, and works inside a function
259 func_contexts = []
260
261 func_contexts.append(
262 (
263 "func",
264 False,
265 dedent(
266 """
267 def f():"""
268 ),
269 )
270 )
271
272 func_contexts.append(
273 (
274 "method",
275 False,
276 dedent(
277 """
278 class MyClass:
279 def __init__(self):
280 """
281 ),
282 )
283 )
284
285 func_contexts.append(
286 (
287 "async-func",
288 True,
289 dedent(
290 """
291 async def f():"""
292 ),
293 )
294 )
295
296 func_contexts.append(
297 (
298 "async-method",
299 True,
300 dedent(
301 """
302 class MyClass:
303 async def f(self):"""
304 ),
305 )
306 )
307
308 func_contexts.append(
309 (
310 "closure",
311 False,
312 dedent(
313 """

Callers

nothing calls this directly

Calls 5

_get_top_level_casesMethod · 0.95
_get_ry_syntax_errorsMethod · 0.95
dedentFunction · 0.85
iprcFunction · 0.85
formatMethod · 0.45

Tested by

no test coverage detected