From 7e670d52e43a69a415b1e1f0b38ba559ea52f17f Mon Sep 17 00:00:00 2001 From: Emmanuel Ferdman Date: Thu, 22 May 2025 01:35:36 +0300 Subject: [PATCH] Display req name on error (#14117) Signed-off-by: Emmanuel Ferdman --- tests/pytype_test.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/pytype_test.py b/tests/pytype_test.py index 3de443dfa..1c5fce2c1 100755 --- a/tests/pytype_test.py +++ b/tests/pytype_test.py @@ -169,7 +169,7 @@ def _get_pkgs_associated_with_requirement(req_name: str) -> list[str]: toplevel_txt_contents = dist.read_text("top_level.txt") if toplevel_txt_contents is None: if dist.files is None: - raise RuntimeError("Can't read find the packages associated with requirement {req_name!r}") + raise RuntimeError(f"Can't read find the packages associated with requirement {req_name!r}") maybe_modules = [f.parts[0] if len(f.parts) > 1 else inspect.getmodulename(f) for f in dist.files] packages = [name for name in maybe_modules if name is not None and "." not in name] else: