Skip to content

Commit 5d59a1d

Browse files
committed
test(backends): fix multiple backends entry point test to account for caching
1 parent bace124 commit 5d59a1d

File tree

1 file changed

+4
-17
lines changed

1 file changed

+4
-17
lines changed

ibis/tests/test_api.py

Lines changed: 4 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
import subprocess
44
import sys
55
from importlib.metadata import EntryPoint
6-
from typing import NamedTuple
76

87
import pytest
98
from pytest import param
@@ -37,24 +36,12 @@ def test_missing_backend():
3736

3837

3938
def test_multiple_backends(mocker):
40-
class Distribution(NamedTuple):
41-
entry_points: list[EntryPoint]
42-
43-
entrypoints = [
44-
EntryPoint(
45-
name="foo",
46-
value="ibis.backends.backend1",
47-
group="ibis.backends",
48-
),
49-
EntryPoint(
50-
name="foo",
51-
value="ibis.backends.backend2",
52-
group="ibis.backends",
53-
),
39+
return_value = [
40+
EntryPoint(name="foo", value="ibis.backends.backend1", group="ibis.backends"),
41+
EntryPoint(name="foo", value="ibis.backends.backend2", group="ibis.backends"),
5442
]
55-
return_value = entrypoints
5643

57-
mocker.patch("importlib.metadata.entry_points", return_value=return_value)
44+
mocker.patch("ibis.util.backend_entry_points", return_value=return_value)
5845

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

0 commit comments

Comments
 (0)