From d54b33141328c27121f0718330a2da1edd8213e3 Mon Sep 17 00:00:00 2001 From: Vsevolod Fedorov Date: Wed, 21 Dec 2022 11:30:59 +0300 Subject: [PATCH] Tests: Do not check output if there are no output files Some test check for error raising. If it is not raised, test should file on that, not on expected output mismatch (not empty). Change-Id: I6c3db840b7ee250ceb1042ca2ddf6d2195b4d547 --- tests/conftest.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/tests/conftest.py b/tests/conftest.py index 64c3d873c..161f0a392 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -100,6 +100,9 @@ def project(input, registry): @pytest.fixture def expected_output(scenario): + if not scenario.out_paths: + # Do not check output if there are no files for it. + return None return "".join(path.read_text() for path in sorted(scenario.out_paths)) @@ -161,6 +164,8 @@ def check_job(scenario, expected_output, jjb_config, registry): .strip() .replace("\n\n", "\n") ) + if expected_output is None: + return stripped_expected_output = ( expected_output.strip().replace("", "").replace("\n\n", "\n") ) @@ -186,6 +191,8 @@ def check_view(scenario, expected_output, jjb_config, registry): .strip() .replace("\n\n", "\n") ) + if expected_output is None: + return stripped_expected_output = ( expected_output.strip().replace("", "").replace("\n\n", "\n") )