This introduces a minimal set of changes to begin using rollup to bundle `pyodide.js`. Once this is merged, I will introduce more PRs to gradually split `pyodide.js` into several files as in #1559.
Use rollup. This introduces a minimal set of changes to begin using rollup to bundle `pyodide.js`. Once this is merged, I will introduce more PRs to gradually split `pyodide.js` into several files as in #1559.
from pyodide_build.testing import set_webdriver_script_timeout


class _MockDriver:
    def set_script_timeout(self, value):
        self._timeout = value


class _MockSelenium:
    script_timeout = 2
    driver = _MockDriver()


def test_set_webdriver_script_timeout():
    selenium = _MockSelenium()
    assert not hasattr(selenium.driver, "_timeout")
    with set_webdriver_script_timeout(selenium, script_timeout=10):
        assert selenium.driver._timeout == 10
    assert selenium.driver._timeout == 2

from pyodide_build.testing import set_webdriver_script_timeout


class _MockDriver:
    def set_script_timeout(self, value):
        self._timeout = value


class _MockSelenium:
    script_timeout = 2
    driver = _MockDriver()


def test_set_webdriver_script_timeout():
    selenium = _MockSelenium()
    assert not hasattr(selenium.driver, "_timeout")
    with set_webdriver_script_timeout(selenium, script_timeout=10):
        assert selenium.driver._timeout == 10
    assert selenium.driver._timeout == 2
