From f3e21128ae106c6f624b7fbbe083a1b1d5200cd2 Mon Sep 17 00:00:00 2001 From: Jonathan Karlsen Date: Wed, 11 Dec 2024 08:08:55 +0100 Subject: [PATCH] fix some tests --- tests/ert/unit_tests/scheduler/test_openpbs_driver.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/tests/ert/unit_tests/scheduler/test_openpbs_driver.py b/tests/ert/unit_tests/scheduler/test_openpbs_driver.py index 1f07366138b..a14e7975c11 100644 --- a/tests/ert/unit_tests/scheduler/test_openpbs_driver.py +++ b/tests/ert/unit_tests/scheduler/test_openpbs_driver.py @@ -140,7 +140,7 @@ def parse_resource_string(qsub_args: str) -> dict[str, str]: async def test_realization_memory(): driver = OpenPBSDriver() await driver.submit(0, "sleep", realization_memory=1024**2) - assert " -l mem=1gb" in Path("captured_qsub_args").read_text(encoding="utf-8") + assert " -l mem=1mb" in Path("captured_qsub_args").read_text(encoding="utf-8") @pytest.mark.usefixtures("capturing_qsub") @@ -151,11 +151,11 @@ async def test_no_default_realization_memory(): @pytest.mark.usefixtures("capturing_qsub") -async def test_no_validation_of_realization_memory(): +async def test_realization_memory_not_negative(): # Validation will happen during config parsing driver = OpenPBSDriver() - await driver.submit(0, realization_memory="a_lot") - assert " -l mem=a_lot" in Path("captured_qsub_args").read_text(encoding="utf-8") + await driver.submit(0, "sleep", realization_memory=-1) + assert " -l " not in Path("captured_qsub_args").read_text(encoding="utf-8") @pytest.mark.usefixtures("capturing_qsub") @@ -261,7 +261,7 @@ async def started(iens): assert was_started == started_expected -@given(words, st.integers(min_value=1), words) +@given(st.integers(), st.integers(min_value=1), words) @pytest.mark.usefixtures("capturing_qsub") async def test_full_resource_string(realization_memory, num_cpu, cluster_label): driver = OpenPBSDriver(