Closes https://github.com/pyodide/pyodide/issues/604

This creates an installable `pyodide-build` Python package that we can also upload to PyPi under https://pypi.org/project/pyodide-build/ (currently uploaded the dev version to reserve the name).

There is also the identically named `pyodide-build` CLI command which replaces `bin/pyodide`.

The short term goals is to use fewer hacks with `PATH` and `PYTHONPATH`. Long term goal make it a user facing interface for building packages instead of the Makefile.
Create an installable pyodide-build package. Closes https://github.com/pyodide/pyodide/issues/604

This creates an installable `pyodide-build` Python package that we can also upload to PyPi under https://pypi.org/project/pyodide-build/ (currently uploaded the dev version to reserve the name).

There is also the identically named `pyodide-build` CLI command which replaces `bin/pyodide`.

The short term goals is to use fewer hacks with `PATH` and `PYTHONPATH`. Long term goal make it a user facing interface for building packages instead of the Makefile.
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
