Skip to content

Commit

Permalink
Use pytest.importorskip for importlib.metadata
Browse files Browse the repository at this point in the history
  • Loading branch information
abravalheri committed May 1, 2024
1 parent 282b873 commit ca5c5a5
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions tests/test_inplace_hooks.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import sys
from inspect import cleandoc
from os.path import abspath, dirname
from os.path import join as pjoin
Expand Down Expand Up @@ -90,8 +89,9 @@ def test_intree_backend_loaded_from_correct_backend_path():
assert res == ["intree_backend_called"]


@pytest.mark.skipif(sys.version_info < (3, 8), reason="no importlib.metadata")
def test_intree_backend_importlib_metadata_interoperation():
pytest.importorskip("importlib.metadata")

hooks = get_hooks("pkg_intree_metadata", backend="intree_backend")
assert hooks.get_requires_for_build_sdist({}) == [
"_test_backend.importlib_metadata",
Expand Down

0 comments on commit ca5c5a5

Please sign in to comment.