Skip to content

Commit da08116

Browse files
committed
test(smoke): add repository root to sys.path for imports
Ensure test can import modules from repository root by adding its path to sys.path before imports
1 parent 33fe8dc commit da08116

1 file changed

Lines changed: 6 additions & 1 deletion

File tree

tests/test_smoke.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,10 @@
11
import inspect
2+
import sys
3+
from pathlib import Path
4+
5+
repository_root = Path(__file__).resolve().parents[1]
6+
if str(repository_root) not in sys.path:
7+
sys.path.insert(0, str(repository_root))
28

39
import postgres_server
410

@@ -7,4 +13,3 @@ def test_creation_tools_exist() -> None:
713
assert inspect.iscoroutinefunction(postgres_server.PostgreSQL_create_schema)
814
assert inspect.iscoroutinefunction(postgres_server.PostgreSQL_create_table)
915
assert inspect.iscoroutinefunction(postgres_server.PostgreSQL_create_index)
10-

0 commit comments

Comments
 (0)