Skip to content

Commit d4b46f3

Browse files
committed
Remove unused PythonList method and enhance dotenv loading in remote e2e tests
1 parent 0db190d commit d4b46f3

2 files changed

Lines changed: 21 additions & 6 deletions

File tree

src/iop/cls/IOP/Test.cls

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -61,12 +61,6 @@ ClassMethod TestBO() As %Status
6161
Return sc
6262
}
6363

64-
/// List
65-
ClassMethod PythonList() [ Language = python ]
66-
{
67-
return [ 1, 3 ]
68-
}
69-
7064
Storage Default
7165
{
7266
<Data name="TestDefaultData">

src/tests/e2e/remote/conftest.py

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,12 +10,33 @@
1010
IOP_NAMESPACE default: USER
1111
1212
Or set IOP_SETTINGS pointing to a settings.py with REMOTE_SETTINGS.
13+
14+
Environment variables can also be provided via a .env.remote file at the
15+
project root, which is loaded automatically before the tests run.
1316
"""
1417
import os
18+
import sys
19+
from pathlib import Path
20+
1521
import pytest
22+
from dotenv import load_dotenv
23+
24+
from os.path import dirname as d, abspath
25+
26+
# src/tests/ root
27+
_tests_dir = d(d(d(abspath(__file__))))
28+
sys.path.append(d(_tests_dir)) # src/
1629

1730
from iop._remote import get_remote_settings
1831

32+
_ENV_FILE = Path(__file__).parents[4] / ".env.remote"
33+
34+
35+
def pytest_configure(config):
36+
"""Load .env.remote from the project root if it exists."""
37+
if _ENV_FILE.exists():
38+
load_dotenv(_ENV_FILE, override=False)
39+
1940

2041
def pytest_collection_modifyitems(config, items):
2142
skip_remote = pytest.mark.skip(

0 commit comments

Comments
 (0)