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.
from pyodide_test_runner import run_in_pyodide


@run_in_pyodide(packages=["lxml"])
def test_lxml():
    from lxml import etree

    root = etree.XML(
        """<root>
        <TEXT1 class="myitem">one</TEXT1>
        <TEXT2 class="myitem">two</TEXT2>
        <TEXT3 class="myitem">three</TEXT3>
        <v-TEXT4 class="v-list">four</v-TEXT4>
    </root>"""
    )

    items = root.xpath("//*[@class='myitem']")
    assert ["one", "two", "three"] == [item.text for item in items]

from pyodide_test_runner import run_in_pyodide


@run_in_pyodide(packages=["lxml"])
def test_lxml():
    from lxml import etree

    root = etree.XML(
        """<root>
        <TEXT1 class="myitem">one</TEXT1>
        <TEXT2 class="myitem">two</TEXT2>
        <TEXT3 class="myitem">three</TEXT3>
        <v-TEXT4 class="v-list">four</v-TEXT4>
    </root>"""
    )

    items = root.xpath("//*[@class='myitem']")
    assert ["one", "two", "three"] == [item.text for item in items]
