Add loadDynlib to micropip._compat (split off from #2591). More work split off of #2591 because #2591 mysteriously fails *all* the github actions tests, even though #2591 currently only changes micropip and not all tests load micropip.
import pytest


def test_init(selenium_esm):
    assert "Python initialization complete" in selenium_esm.logs.splitlines()


def test_print(selenium_esm):
    selenium_esm.run("print('This should be logged')")
    assert "This should be logged" in selenium_esm.logs.splitlines()


@pytest.mark.xfail_browsers(node="No window in node")
def test_import_js(selenium_esm):
    result = selenium_esm.run(
        """
        import js
        js.window.title = 'Foo'
        js.window.title
        """
    )
    assert result == "Foo"
    result = selenium_esm.run(
        """
        dir(js)
        """
    )
    assert len(result) > 100
    assert "document" in result
    assert "window" in result

import pytest


def test_init(selenium_esm):
    assert "Python initialization complete" in selenium_esm.logs.splitlines()


def test_print(selenium_esm):
    selenium_esm.run("print('This should be logged')")
    assert "This should be logged" in selenium_esm.logs.splitlines()


@pytest.mark.xfail_browsers(node="No window in node")
def test_import_js(selenium_esm):
    result = selenium_esm.run(
        """
        import js
        js.window.title = 'Foo'
        js.window.title
        """
    )
    assert result == "Foo"
    result = selenium_esm.run(
        """
        dir(js)
        """
    )
    assert len(result) > 100
    assert "document" in result
    assert "window" in result
