MCPcopy
hub / github.com/pyodide/pyodide / test_pyproxy_iter_error2

Function test_pyproxy_iter_error2

src/tests/test_pyproxy.py:287–305  ·  view source on GitHub ↗
(selenium)

Source from the content-addressed store, hash-verified

285
286@run_in_pyodide
287def test_pyproxy_iter_error2(selenium):
288 from pyodide.code import run_js
289
290 def g():
291 yield 1
292 yield 2
293 raise Exception("hi")
294 yield 3 # type: ignore[unreachable]
295
296 gen = g()
297 run_js(
298 """
299 (gen) => {
300 assert(() => gen.next().value === 1);
301 assert(() => gen.next().value === 2);
302 assertThrows(() => gen.next(), "PythonError", "hi");
303 }
304 """
305 )(gen)
306
307
308@run_in_pyodide

Callers

nothing calls this directly

Calls 2

run_jsFunction · 0.90
gFunction · 0.70

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…