Skip to content

Commit

Permalink
Testing: Add parent package to path to allow absolute import
Browse files Browse the repository at this point in the history
  • Loading branch information
hlorus committed Mar 20, 2024
1 parent 34e1502 commit c382fc4
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 3 deletions.
7 changes: 7 additions & 0 deletions testing/__init__.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,17 @@
import sys
import unittest
from unittest import TestCase
from pathlib import Path
import logging

logger = logging.getLogger(__name__)

# Add parent directory to sys.path to allow importing from testing
module_path = Path(__file__).parent.parent.as_posix()
if module_path not in sys.path:
sys.path.append(module_path)



def run(interactive, log_level=None):
from CAD_Sketcher.testing import test_solver
Expand Down
2 changes: 1 addition & 1 deletion testing/test_constraint_init.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import math
from unittest import skip

from CAD_Sketcher.testing.utils import Sketch2dTestCase
from testing.utils import Sketch2dTestCase


class TestConstraintAdd(Sketch2dTestCase):
Expand Down
2 changes: 1 addition & 1 deletion testing/test_core.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
from unittest import skip
from CAD_Sketcher.testing.utils import BgsTestCase
from testing.utils import BgsTestCase
from CAD_Sketcher.model.types import SlvsPoint3D
from CAD_Sketcher.model.utilities import slvs_entity_pointer

Expand Down
3 changes: 2 additions & 1 deletion testing/test_solver.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
from unittest import skip
from CAD_Sketcher.testing.utils import BgsTestCase, Sketch2dTestCase

from testing.utils import BgsTestCase, Sketch2dTestCase


class TestSolver(BgsTestCase):
Expand Down

0 comments on commit c382fc4

Please sign in to comment.