### Description

Close #2226

Refactors matplotlib tests:

- Prevent dangling selenium webdriver after test
- For asynchronous tests, use promise-await instead of selenium WebDriverWait
- Enable xfailed tests

<!--
- [ ] Add a [CHANGELOG](https://github.com/pyodide/pyodide/blob/main/docs/project/changelog.md) entry
- [ ] Add / update tests
- [ ] Add new / update outdated documentation
!-->

Refactor matplotlib tests. ### Description

Close #2226

Refactors matplotlib tests:

- Prevent dangling selenium webdriver after test
- For asynchronous tests, use promise-await instead of selenium WebDriverWait
- Enable xfailed tests

<!--
- [ ] Add a [CHANGELOG](https://github.com/pyodide/pyodide/blob/main/docs/project/changelog.md) entry
- [ ] Add / update tests
- [ ] Add new / update outdated documentation
!-->

from pyodide_build.testing import run_in_pyodide


@run_in_pyodide(standalone=True, packages=["jedi"])
def test_jedi():
    import jedi

    script = jedi.Script("import json\njson.lo", path="example.py")
    completions = script.complete(2, len("json.lo"))
    assert [el.name for el in completions] == ["load", "loads"]

from pyodide_build.testing import run_in_pyodide


@run_in_pyodide(standalone=True, packages=["jedi"])
def test_jedi():
    import jedi

    script = jedi.Script("import json\njson.lo", path="example.py")
    completions = script.complete(2, len("json.lo"))
    assert [el.name for el in completions] == ["load", "loads"]
