MAINT Add pytest.mark.xfail_browsers and use it to reduce boilerplate. Use a decorator to indicate which browsers we want to xfail test. This works for `run_in_pyodide` as well as normal tests.
import pytest


@pytest.mark.driver_timeout(40)
def test_pyb2d(selenium_standalone, request):
    selenium = selenium_standalone
    selenium.load_package("pyb2d")

    selenium.run(
        """
        import numpy as np
        import b2d
        w = b2d.world(gravity=(0,-10))
        """
    )

import pytest


@pytest.mark.driver_timeout(40)
def test_pyb2d(selenium_standalone, request):
    selenium = selenium_standalone
    selenium.load_package("pyb2d")

    selenium.run(
        """
        import numpy as np
        import b2d
        w = b2d.world(gravity=(0,-10))
        """
    )
