QTZPOC-20

QTZPOC-20: Refactor test inputs into named variables for improved readability and debugging.
This commit is contained in:
2026-09-04 11:35:34 -03:00
parent 7b2e90a9f9
commit d257e70465
7 changed files with 141 additions and 67 deletions

View File

@@ -2077,8 +2077,10 @@ def test_find_model_pickle_ignores_nested_pickles(mlflow_repository, tmp_path):
nested.mkdir()
(nested / 'stacking_model.pkl').write_bytes(b'pickle-bytes')
local_dir = str(tmp_path)
with pytest.raises(ValueError) as exc_info:
mlflow_repository._find_model_pickle(str(tmp_path), 'prediction_model')
mlflow_repository._find_model_pickle(local_dir, 'prediction_model')
assert 'No .pkl file found' in str(exc_info.value)
@@ -2093,8 +2095,10 @@ def test_find_model_pickle_reads_the_name_log_model_writes(mlflow_repository, tm
def test_find_model_pickle_empty_directory(mlflow_repository, tmp_path):
local_dir = str(tmp_path)
with pytest.raises(ValueError) as exc_info:
mlflow_repository._find_model_pickle(str(tmp_path), 'data_model')
mlflow_repository._find_model_pickle(local_dir, 'data_model')
assert 'data_model' in str(exc_info.value)
@@ -2113,9 +2117,10 @@ def test_find_model_pickle_error_message_carries_context(mlflow_repository, tmp_
def test_find_model_pickle_ignores_directory_named_pkl(mlflow_repository, tmp_path):
(tmp_path / 'algo.pkl').mkdir()
local_dir = str(tmp_path)
with pytest.raises(ValueError) as exc_info:
mlflow_repository._find_model_pickle(str(tmp_path), 'prediction_model')
mlflow_repository._find_model_pickle(local_dir, 'prediction_model')
assert 'algo.pkl' in str(exc_info.value)