diff --git a/tests/extract/local_test_installation.py b/tests/extract/local_test_installation.py index 10a8200f8..89c5cb0c7 100644 --- a/tests/extract/local_test_installation.py +++ b/tests/extract/local_test_installation.py @@ -1,5 +1,14 @@ import os +import pathlib +import sys from unittest import TestCase +import unittest + +if not getattr(sys, "frozen", False): + thisfile_path = pathlib.Path(__file__).resolve() + project_root = thisfile_path.parents[2] + if project_root.joinpath("pykotor").exists(): + sys.path.append(str(project_root)) from pykotor.common.language import LocalizedString from pykotor.common.misc import Game @@ -9,7 +18,6 @@ from pykotor.resource.type import ResourceType from pykotor.tools.path import Path, locate_game_paths - class TestInstallation(TestCase): def setUp(self) -> None: path = os.environ.get("K1_PATH") @@ -381,3 +389,7 @@ def test_strings(self): self.assertEqual("default text", results[locstring1]) self.assertEqual("Some text.", results[locstring2]) self.assertEqual("ERROR: FATAL COMPILER ERROR", results[locstring3]) + + +if __name__ == "__main__": + unittest.main() \ No newline at end of file