Skip to content

Commit

Permalink
[cdd/tests/test_shared/test_pkg_utils.py] Backtrack how test should l…
Browse files Browse the repository at this point in the history
…ook for `get_python_lib` on GitHub Actions
  • Loading branch information
SamuelMarks committed Mar 15, 2024
1 parent 17a6c55 commit 0e6f7e0
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion cdd/tests/test_shared/test_pkg_utils.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
""" Tests for pkg utils """

from os import path
from site import getsitepackages
from unittest import TestCase

Expand All @@ -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()

0 comments on commit 0e6f7e0

Please sign in to comment.