Skip to content

Commit

Permalink
Fix retro with 2024.2.pre0 for test_license_agr
Browse files Browse the repository at this point in the history
Signed-off-by: paul.profizi <[email protected]>
  • Loading branch information
PProfizi committed Mar 11, 2024
1 parent 0332c3e commit 3d825b8
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
4 changes: 3 additions & 1 deletion tests/entry/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"
)
Expand Down
8 changes: 6 additions & 2 deletions tests/entry/test_entry.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down

0 comments on commit 3d825b8

Please sign in to comment.