diff --git a/.idea/workspace.xml b/.idea/workspace.xml new file mode 100644 index 0000000..d9d2958 --- /dev/null +++ b/.idea/workspace.xml @@ -0,0 +1,132 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 1641999342461 + + + + + + + + + + + file://$PROJECT_DIR$/build/lib/tests/test_run.py + + + file://$PROJECT_DIR$/build/lib/tests/test_run.py + 9 + + + file://$PROJECT_DIR$/tests/test_run.py + 11 + + + file://$PROJECT_DIR$/tests/test_end_to_end.py + 1 + + + + + \ No newline at end of file diff --git a/tests/test_run.py b/tests/test_run.py index 6050ef2..bb21e61 100644 --- a/tests/test_run.py +++ b/tests/test_run.py @@ -1,4 +1,6 @@ +import io import logging +import sys from unittest import mock import pandas as pd @@ -215,3 +217,28 @@ def test_raise_if_valiation_returns_privilidged_key_name(result, mocker, tmpdir) validation_registry, results_path=results_path, ) + + +def test_congrats_printed(mocker, tmpdir): + _ = mocker.patch( + "kotsu.run._run_validation_model", + side_effect=[({"test_result": "result"}, 10), ({"test_result": "result_2"}, 20)], + ) + _ = mocker.patch("kotsu.store.write") + + models = ["model_1", "model_2"] + model_registry = FakeRegistry(models) + validations = ["validation_1"] + validation_registry = FakeRegistry(validations) + + results_path = str(tmpdir) + "validation_results.csv" + + capturedOutput = io.StringIO() # Create StringIO object + sys.stdout = capturedOutput + + kotsu.run.run(model_registry, validation_registry, results_path=results_path) + + sys.stdout = sys.__stdout__ # Reset redirect + + expect = "hi datavaluepeople, Flora here, congrats on getting to the end of your run function!" + assert expect in capturedOutput.getvalue()