From 3d825b8ffcee332eca30aed657bac68e0a9b0a3c Mon Sep 17 00:00:00 2001 From: "paul.profizi" Date: Mon, 11 Mar 2024 11:15:18 +0100 Subject: [PATCH] Fix retro with 2024.2.pre0 for test_license_agr Signed-off-by: paul.profizi --- tests/entry/conftest.py | 4 +++- tests/entry/test_entry.py | 8 ++++++-- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/tests/entry/conftest.py b/tests/entry/conftest.py index 9f4183f84a..3a01faee32 100644 --- a/tests/entry/conftest.py +++ b/tests/entry/conftest.py @@ -47,7 +47,9 @@ def _get_test_files_directory(): _get_test_files_directory() ] = "/tmp/test_files" - +SERVERS_VERSION_GREATER_THAN_OR_EQUAL_TO_8_1 = meets_version( + get_server_version(core._global_server()), "8.1" +) SERVERS_VERSION_GREATER_THAN_OR_EQUAL_TO_8_0 = meets_version( get_server_version(core._global_server()), "8.0" ) diff --git a/tests/entry/test_entry.py b/tests/entry/test_entry.py index d10427369e..e1944a4b2d 100644 --- a/tests/entry/test_entry.py +++ b/tests/entry/test_entry.py @@ -22,10 +22,14 @@ def test_license_agr(restore_accept_la_env): config = dpf.AvailableServerConfigs.InProcessServer init_val = os.environ["ANSYS_DPF_ACCEPT_LA"] del os.environ["ANSYS_DPF_ACCEPT_LA"] - with pytest.raises(errors.DPFServerException): + if conftest.SERVERS_VERSION_GREATER_THAN_OR_EQUAL_TO_8_0 and not conftest.SERVERS_VERSION_GREATER_THAN_OR_EQUAL_TO_8_1: dpf.start_local_server(config=config, as_global=True) - with pytest.raises(errors.DPFServerException): dpf.Operator("stream_provider") + else: + with pytest.raises(errors.DPFServerException): + dpf.start_local_server(config=config, as_global=True) + with pytest.raises(errors.DPFServerException): + dpf.Operator("stream_provider") os.environ["ANSYS_DPF_ACCEPT_LA"] = init_val dpf.start_local_server(config=config, as_global=True) assert "static" in examples.find_static_rst()