mirror of
https://github.com/NVIDIA/nvbench.git
synced 2026-07-12 10:07:40 +00:00
Harden tooling dependency import tests
This commit is contained in:
@@ -29,10 +29,17 @@ def test_tooling_deps_imports_from_packaged_script_path(tmp_path, monkeypatch):
|
||||
)
|
||||
|
||||
monkeypatch.syspath_prepend(str(tmp_path))
|
||||
sys.modules.pop("cuda.bench.scripts.nvbench_tooling_deps", None)
|
||||
for module_name in [
|
||||
"cuda",
|
||||
"cuda.bench",
|
||||
"cuda.bench.scripts",
|
||||
"cuda.bench.scripts.nvbench_tooling_deps",
|
||||
]:
|
||||
monkeypatch.delitem(sys.modules, module_name, raising=False)
|
||||
|
||||
module = importlib.import_module("cuda.bench.scripts.nvbench_tooling_deps")
|
||||
|
||||
assert Path(module.__file__) == package_dir / "nvbench_tooling_deps.py"
|
||||
assert module.ToolingDependency("math", "math", "testing").extra == "tools"
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user