I moved the package loading code from pyodide.js into a separate file without other changes.
More specifically I changed `let loadScript;` ==> `export let loadScript;` and I added `import { Module } from "./module";` to the top of the file. Also everything got de-indented.
Split off load-pyodide.js from pyodide.js. I moved the package loading code from pyodide.js into a separate file without other changes.
More specifically I changed `let loadScript;` ==> `export let loadScript;` and I added `import { Module } from "./module";` to the top of the file. Also everything got de-indented.
def test_pyodide_interrupts(selenium):
    selenium.load_package("pyodide-interrupts")
    selenium.run("from pyodide_interrupts import check_interrupts")
    assert (
        selenium.run(
            "x = 0\n"
            "def callback():\n"
            "    global x\n"
            "    print('check')\n"
            "    x += 1\n"
            "with check_interrupts(callback, 10):\n"
            "    for i in range(50):\n"
            "        print(i, end=',')\n"
            "x"
        )
        == 11
    )

def test_pyodide_interrupts(selenium):
    selenium.load_package("pyodide-interrupts")
    selenium.run("from pyodide_interrupts import check_interrupts")
    assert (
        selenium.run(
            "x = 0\n"
            "def callback():\n"
            "    global x\n"
            "    print('check')\n"
            "    x += 1\n"
            "with check_interrupts(callback, 10):\n"
            "    for i in range(50):\n"
            "        print(i, end=',')\n"
            "x"
        )
        == 11
    )
