Skip to content

Commit 48a3cdc

Browse files
committed
Refactor test_batch_cmoriser.py to improve security comments and clarify subprocess usage
1 parent 237d83f commit 48a3cdc

1 file changed

Lines changed: 8 additions & 1 deletion

File tree

tests/unit/test_batch_cmoriser.py

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,10 @@
1+
"""Unit tests for batch CMORiser functionality."""
2+
3+
# Security: All subprocess usage in this file is for mocking in unit tests
4+
# ruff: noqa: S603, S607
5+
# bandit: skip
6+
# semgrep: skip
7+
18
from unittest.mock import Mock, mock_open, patch
29

310
import pytest
@@ -57,7 +64,7 @@ def test_submit_job_success(self, mock_run):
5764
@pytest.mark.unit
5865
def test_submit_job_failure(self, mock_run):
5966
"""Test failed job submission."""
60-
import subprocess
67+
import subprocess # nosec # Only used for mocking CalledProcessError in tests
6168

6269
mock_run.side_effect = subprocess.CalledProcessError(
6370
returncode=1,

0 commit comments

Comments
 (0)