Update test results directory structure and enhance Docker configurations

- Modified `.gitignore` to reflect the new path for test results.
- Updated `docker-compose.test.yml` to mount the correct test results directory.
- Adjusted `Dockerfile.test` to set the `PYTHONPATH` and ensure test results are saved in the updated location.
- Added `boto3` and `netron` to `requirements-test.txt` to support new functionalities.
- Updated `pytest.ini` to include the new `pythonpath` for test discovery.

These changes streamline the testing process and ensure compatibility with the updated directory structure.
This commit is contained in:
Oleksandr Bezdieniezhnykh
2026-03-28 00:13:08 +02:00
parent c20018745b
commit 243b69656b
48 changed files with 707 additions and 581 deletions
+10 -9
View File
@@ -1,39 +1,40 @@
import sys
import types
for _name in ("ultralytics", "boto3", "netron", "requests"):
if _name not in sys.modules:
sys.modules[_name] = types.ModuleType(_name)
sys.modules["ultralytics"].YOLO = type("YOLO", (), {})
sys.modules["boto3"].client = lambda *a, **k: None
from train import check_label
def test_bt_lbl_01_valid_label_returns_true(tmp_path):
# Arrange
p = tmp_path / "a.txt"
p.write_text("0 0.5 0.5 0.1 0.1", encoding="utf-8")
# Assert
assert check_label(str(p)) is True
def test_bt_lbl_02_x_gt_one_returns_false(tmp_path):
# Arrange
p = tmp_path / "a.txt"
p.write_text("0 1.5 0.5 0.1 0.1", encoding="utf-8")
# Assert
assert check_label(str(p)) is False
def test_bt_lbl_03_height_gt_one_returns_false(tmp_path):
# Arrange
p = tmp_path / "a.txt"
p.write_text("0 0.5 0.5 0.1 1.2", encoding="utf-8")
# Assert
assert check_label(str(p)) is False
def test_bt_lbl_04_missing_file_returns_false(tmp_path):
# Arrange
p = tmp_path / "missing.txt"
# Assert
assert check_label(str(p)) is False
def test_bt_lbl_05_multiline_one_corrupted_returns_false(tmp_path):
# Arrange
p = tmp_path / "a.txt"
p.write_text("0 0.5 0.5 0.1 0.1\n3 0.5 0.5 0.1 1.5", encoding="utf-8")
# Assert
assert check_label(str(p)) is False