Skip to content

Commit

Permalink
fix: already entered issue
Browse files Browse the repository at this point in the history
  • Loading branch information
germa89 committed Nov 25, 2024
1 parent eeaf49d commit 0079d55
Showing 1 changed file with 7 additions and 10 deletions.
17 changes: 7 additions & 10 deletions tests/test_launcher.py
Original file line number Diff line number Diff line change
Expand Up @@ -1790,23 +1790,20 @@ def test_get_version_env_var(monkeypatch, version):
pytest.raises(VersionError, match="Running MAPDL as a service requires"),
None,
],
["anymode", None, "posix", warnings.catch_warnings(record=True), "anymode"],
[
"anymode",
None,
"posix",
pytest.warns(UserWarning, match="PyMAPDL couldn't detect MAPDL version"),
"anymode",
],
],
)
def test_check_mode(mode, version, osname, context, res):
with patch("os.name", osname):
with context as cnt:
assert res == check_mode(mode, version)

if mode is not None and version is None:
# check warning
for each in cnt:
if "PyMAPDL couldn't detect MAPDL version" in each.message.args[0]:
break
else:
# if using the break above, this 'else' is not executed.
assert False, "The expected warning was not raised"


@pytest.mark.parametrize("jobid", [1001, 2002])
@patch("subprocess.Popen", lambda *args, **kwargs: None)
Expand Down

0 comments on commit 0079d55

Please sign in to comment.