Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 7 additions & 3 deletions tests/test_all_perturbations.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import hashlib
import yaml
import os
import shutil
Expand Down Expand Up @@ -26,9 +27,12 @@ def run_generation(config_params):
args.load.scenarios = 5
args.settings.large_chunk_size = 5
args.settings.num_processes = 2
args.settings.data_dir = (
f"./tests/test_data_perturbations/{config_params['test_name']}"
)
# Use a short hash as the directory name to avoid hitting the
# Windows MAX_PATH (260-char) limit with long combination names.
short_id = hashlib.sha1(
config_params["test_name"].encode(), usedforsecurity=False
).hexdigest()[:12]
args.settings.data_dir = f"./tests/test_data_perturbations/{short_id}"

# Generate data
file_paths = generate_power_flow_data_distributed(args)
Expand Down
4 changes: 4 additions & 0 deletions tests/test_solver_output.py
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,10 @@ class TestRedirectCStdio:
# Write straight to fd 1/2 (and via libc), not print(): the whole point is
# capturing fd-level output that bypasses Python's sys.stdout.

@pytest.mark.skipif(
os.name == "nt",
reason="ctypes.CDLL(None) does not load libc on Windows",
)
def test_redirects_c_level_writes_to_file(self, tmp_path, capfd):
libc = ctypes.CDLL(None)
log = tmp_path / "out.log"
Expand Down
Loading