run_for_optional_imports

run_for_optional_imports(modules: str | Iterable[str], dep_target: str) -> Callable[[~G], ~G]

Decorator to run a test if and only if optional modules are installed

Parameters:
NameDescription
modulesModule name or list of module names

Type: str | Iterable[str]
dep_targetTarget name for pip installation (e.g.

‘test’ in pip install ag2[test])

Type: str