Skip to content

Commit

Permalink
test(backends): fix multiple backends entry point test to account for…
Browse files Browse the repository at this point in the history
… caching
  • Loading branch information
cpcloud committed Feb 24, 2025
1 parent bace124 commit 5d59a1d
Showing 1 changed file with 4 additions and 17 deletions.
21 changes: 4 additions & 17 deletions ibis/tests/test_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
import subprocess
import sys
from importlib.metadata import EntryPoint
from typing import NamedTuple

import pytest
from pytest import param
Expand Down Expand Up @@ -37,24 +36,12 @@ def test_missing_backend():


def test_multiple_backends(mocker):
class Distribution(NamedTuple):
entry_points: list[EntryPoint]

entrypoints = [
EntryPoint(
name="foo",
value="ibis.backends.backend1",
group="ibis.backends",
),
EntryPoint(
name="foo",
value="ibis.backends.backend2",
group="ibis.backends",
),
return_value = [
EntryPoint(name="foo", value="ibis.backends.backend1", group="ibis.backends"),
EntryPoint(name="foo", value="ibis.backends.backend2", group="ibis.backends"),
]
return_value = entrypoints

mocker.patch("importlib.metadata.entry_points", return_value=return_value)
mocker.patch("ibis.util.backend_entry_points", return_value=return_value)

msg = r"\d+ packages found for backend 'foo'"
with pytest.raises(RuntimeError, match=msg):
Expand Down

0 comments on commit 5d59a1d

Please sign in to comment.