Skip to content

Commit

Permalink
Fix pre-commit
Browse files Browse the repository at this point in the history
  • Loading branch information
hoodmane committed Nov 11, 2024
1 parent 8a26541 commit d972d6e
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/tests/test_pyodide.py
Original file line number Diff line number Diff line change
Expand Up @@ -1524,14 +1524,14 @@ def test_importhook_called_from_pytest(selenium):
`find_spec("a.b")` directly here:
https://github.com/pytest-dev/pytest/blob/ea0fa639445ae08616edd2c15189a1a76168f018/src/_pytest/pathlib.py#L693-L698
This previously could lead to crashes in `JsFinder`.
This previously could lead to KeyError being raised in `JsFinder`.
"""
import sys

def _import_module_using_spec(module_name):
"""Modeled on a fragment of _pytest.pathlib._import_module_using_spec"""
for meta_importer in sys.meta_path:
spec = meta_importer.find_spec(module_name, path=[])
meta_importer.find_spec(module_name, path=[])

# Assertion: This should not raise KeyError.
_import_module_using_spec("a.b")
Expand Down

0 comments on commit d972d6e

Please sign in to comment.