MCPcopy
hub / github.com/pyodide/pyodide / test_pyproxy_destroy

Function test_pyproxy_destroy

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

Source from the content-addressed store, hash-verified

189
190@run_in_pyodide
191def test_pyproxy_destroy(selenium):
192 from pyodide.code import run_js
193
194 class Foo:
195 def get_value(self, value):
196 return value * 64
197
198 f = Foo()
199 run_js(
200 """
201 (f) => {
202 assert(()=> f.get_value(1) === 64);
203 f.destroy();
204 assertThrows(() => f.get_value(1), "Error", "already been destroyed");
205 }
206 """
207 )(f)
208
209
210@run_in_pyodide

Callers

nothing calls this directly

Calls 2

run_jsFunction · 0.90
FooClass · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…