MCPcopy
hub / github.com/pyodide/pyodide / test_pyproxy_iter_error

Function test_pyproxy_iter_error

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

Source from the content-addressed store, hash-verified

267
268@run_in_pyodide
269def test_pyproxy_iter_error(selenium):
270 from pyodide.code import run_js
271
272 class T:
273 def __iter__(self):
274 raise Exception("hi")
275
276 t = T()
277 run_js(
278 """
279 (t) => {
280 assertThrows(() => t[Symbol.iterator](), "PythonError", "hi");
281 }
282 """
283 )(t)
284
285
286@run_in_pyodide

Callers

nothing calls this directly

Calls 2

run_jsFunction · 0.90
TClass · 0.70

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…