Skip to content

Commit 5f28a14

Browse files
authored
Fix retro with 2024.2.pre0 for test_license_agr (#1465)
Signed-off-by: paul.profizi <[email protected]>
1 parent 0332c3e commit 5f28a14

File tree

2 files changed

+9
-3
lines changed

2 files changed

+9
-3
lines changed

tests/entry/conftest.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,9 @@ def _get_test_files_directory():
4747
_get_test_files_directory()
4848
] = "/tmp/test_files"
4949

50-
50+
SERVERS_VERSION_GREATER_THAN_OR_EQUAL_TO_8_1 = meets_version(
51+
get_server_version(core._global_server()), "8.1"
52+
)
5153
SERVERS_VERSION_GREATER_THAN_OR_EQUAL_TO_8_0 = meets_version(
5254
get_server_version(core._global_server()), "8.0"
5355
)

tests/entry/test_entry.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,10 +22,14 @@ def test_license_agr(restore_accept_la_env):
2222
config = dpf.AvailableServerConfigs.InProcessServer
2323
init_val = os.environ["ANSYS_DPF_ACCEPT_LA"]
2424
del os.environ["ANSYS_DPF_ACCEPT_LA"]
25-
with pytest.raises(errors.DPFServerException):
25+
if conftest.SERVERS_VERSION_GREATER_THAN_OR_EQUAL_TO_8_0 and not conftest.SERVERS_VERSION_GREATER_THAN_OR_EQUAL_TO_8_1:
2626
dpf.start_local_server(config=config, as_global=True)
27-
with pytest.raises(errors.DPFServerException):
2827
dpf.Operator("stream_provider")
28+
else:
29+
with pytest.raises(errors.DPFServerException):
30+
dpf.start_local_server(config=config, as_global=True)
31+
with pytest.raises(errors.DPFServerException):
32+
dpf.Operator("stream_provider")
2933
os.environ["ANSYS_DPF_ACCEPT_LA"] = init_val
3034
dpf.start_local_server(config=config, as_global=True)
3135
assert "static" in examples.find_static_rst()

0 commit comments

Comments
 (0)