From 0e6f7e08f9f3d47c9009df0e094fc1965c6277a8 Mon Sep 17 00:00:00 2001 From: Samuel Marks <807580+SamuelMarks@users.noreply.github.com> Date: Fri, 15 Mar 2024 16:43:52 -0400 Subject: [PATCH] [cdd/tests/test_shared/test_pkg_utils.py] Backtrack how test should look for `get_python_lib` on GitHub Actions --- cdd/tests/test_shared/test_pkg_utils.py | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/cdd/tests/test_shared/test_pkg_utils.py b/cdd/tests/test_shared/test_pkg_utils.py index 537c08f4..0098cba3 100644 --- a/cdd/tests/test_shared/test_pkg_utils.py +++ b/cdd/tests/test_shared/test_pkg_utils.py @@ -1,5 +1,6 @@ """ Tests for pkg utils """ +from os import path from site import getsitepackages from unittest import TestCase @@ -17,7 +18,18 @@ def test_relative_filename(self) -> None: def test_get_python_lib(self) -> None: """Tests that `get_python_lib` works""" - self.assertEqual(getsitepackages()[0], get_python_lib()) + site_packages = getsitepackages()[0] + python_lib = get_python_lib() + if site_packages != python_lib: + site_packages = path.dirname(path.dirname(site_packages)) + self.assertEqual( + ( + site_packages + if site_packages == python_lib + else path.join(site_packages, "python3", "dist-packages") + ), + python_lib, + ) unittest_main()