From 895007c986e7abe2748a87bd8802d730facd4ff6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?H=C3=A5vard=20Berland?= Date: Tue, 30 Aug 2022 09:31:29 +0200 Subject: [PATCH] Make integration test compatible with ERT 3.0.0 --- tests/jobs/csv_export2/test_integration.py | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/tests/jobs/csv_export2/test_integration.py b/tests/jobs/csv_export2/test_integration.py index f3f7ec95a..3be93e77c 100644 --- a/tests/jobs/csv_export2/test_integration.py +++ b/tests/jobs/csv_export2/test_integration.py @@ -1,6 +1,7 @@ # pylint: disable=unsubscriptable-object # pylint issue import os import subprocess +from pathlib import Path import pandas as pd import pytest @@ -261,13 +262,10 @@ def test_ert_integration_errors(snapshot): file_h.write("\n".join(ert_config)) subprocess.run(["ert", "test_run", ert_config_fname], check=True) - log_file = "ert-log" - for file in os.listdir(): - if file.startswith(log_file): - log_file = file - break - with open(log_file) as fin: - ertlog = fin.read() + + log_file = next(Path("logs").glob("ert-log*txt")) + ertlog = log_file.read_text(encoding="utf-8") + assert "No STATUS file" in ertlog assert "realization-2/iter-0" in ertlog