Skip to content

Commit f3c00f8

Browse files
committed
Replace plugin-installing test with plugin-in-venv test
1 parent 8256146 commit f3c00f8

File tree

1 file changed

+10
-3
lines changed

1 file changed

+10
-3
lines changed

tests/plugins/test_loader.py

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
import re
44
import sys
55
from functools import partial
6+
from pathlib import Path
67
from typing import Callable
78

89
import pytest
@@ -458,7 +459,9 @@ def test_load_plugins_from_entry_points(mocked_entry_points: None) -> None:
458459
}
459460

460461

461-
def test_install_plugin(test_plugin_package_req: str) -> None:
462+
def test_plugin_in_venv(test_plugin_package_req: str) -> None:
463+
from build.env import DefaultIsolatedEnv
464+
462465
variant_info = VariantInfo(
463466
namespace_priorities=["installable_plugin"],
464467
providers={
@@ -469,8 +472,12 @@ def test_install_plugin(test_plugin_package_req: str) -> None:
469472
},
470473
)
471474

472-
with PluginLoader(variant_info, use_auto_install=True, isolated=True) as loader:
473-
assert set(loader.namespaces) == {"installable_plugin"}
475+
with DefaultIsolatedEnv() as venv:
476+
venv.install([test_plugin_package_req])
477+
with PluginLoader(
478+
variant_info, use_auto_install=False, venv_path=Path(venv.path)
479+
) as loader:
480+
assert set(loader.namespaces) == {"installable_plugin"}
474481

475482

476483
def test_no_plugin_api(test_plugin_package_req: str) -> None:

0 commit comments

Comments
 (0)