mirror of
https://github.com/pyscript/pyscript.git
synced 2026-03-17 22:00:14 -04:00
Refactor named workers test to avoid circular dependencies + free CI (#2212)
* Refactor named workers test to avoid circular dependencies + free CI
This commit is contained in:
committed by
GitHub
parent
febbb031ac
commit
a6b6dd8479
@@ -1,19 +1,13 @@
|
||||
from pyscript import document, workers
|
||||
|
||||
|
||||
async def test(interpreter):
|
||||
# accessed as item
|
||||
named = await workers.micropython_version
|
||||
async def test(name):
|
||||
# retrieve sync utilities from the named worker
|
||||
named = await workers[name]
|
||||
|
||||
version = await named.micropython_version()
|
||||
# invoke the runtime_version __export__ + show it
|
||||
version = await named.runtime_version()
|
||||
document.body.append(version)
|
||||
document.body.append(document.createElement("hr"))
|
||||
|
||||
# accessed as attribute
|
||||
named = await workers["pyodide_version"]
|
||||
|
||||
version = await named.pyodide_version()
|
||||
document.body.append(version)
|
||||
document.body.append(document.createElement("hr"))
|
||||
|
||||
document.documentElement.classList.add(interpreter)
|
||||
# flag the expectations around name done
|
||||
document.documentElement.classList.add(name)
|
||||
|
||||
Reference in New Issue
Block a user