From 89eae7d359bb6a7c522bcdecbb653b34e705100c Mon Sep 17 00:00:00 2001 From: Bianca Henderson Date: Wed, 3 Apr 2024 16:52:59 -0400 Subject: [PATCH] Remove sys.exit call in inspect_objects() and add test --- tests/test_inspect_pkg.py | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/tests/test_inspect_pkg.py b/tests/test_inspect_pkg.py index 76ddd51e12..4f20b85105 100644 --- a/tests/test_inspect_pkg.py +++ b/tests/test_inspect_pkg.py @@ -11,8 +11,8 @@ from conda.core.prefix_data import PrefixData from conda_build.exceptions import CondaBuildUserError -from conda_build.inspect_pkg import inspect_linkages, which_package -from conda_build.utils import on_win +from conda_build.inspect_pkg import inspect_linkages, inspect_objects, which_package +from conda_build.utils import on_mac, on_win def test_which_package(tmp_path: Path): @@ -289,3 +289,9 @@ def test_inspect_linkages_on_win(): def test_inspect_linkages_not_installed(): with pytest.raises(CondaBuildUserError): inspect_linkages(["not_installed_pkg"]) + + +@pytest.mark.skipif(on_mac, reason="inspect_objects is only available on macOS") +def test_inspect_objects_not_on_mac(): + with pytest.raises(CondaBuildUserError): + inspect_objects([])