Skip to content

Commit

Permalink
Ignoring pymapdl_start_instance env var on CLI
Browse files Browse the repository at this point in the history
  • Loading branch information
german committed Mar 19, 2024
1 parent 32fb872 commit 90c5bcd
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
4 changes: 4 additions & 0 deletions src/ansys/mapdl/core/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -470,6 +470,10 @@ def start(
+ " The following argument is not allowed in CLI: 'license_server_check'.\nIgnoring argument."
)

# Ignoring env var if using CLI
if "PYMAPDL_START_INSTANCE" in os.environ:
os.environ.pop("PYMAPDL_START_INSTANCE")

out = launch_mapdl(
exec_file=exec_file,
just_launch=True,
Expand Down
8 changes: 7 additions & 1 deletion tests/test_cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,13 @@ def do_run(arguments=""):
@requires("click")
@requires("local")
@requires("nostudent")
def test_launch_mapdl_cli(run_cli):
@pytest.mark.parametrize("start_instance", [None, True, False] )
def test_launch_mapdl_cli(monkeypatch, run_cli, start_instance):
if start_instance is not None:
monkeypatch.setenv("PYMAPDL_START_INSTANCE", str(start_instance))
else:
monkeypatch.unset("PYMAPDL_START_INSTANCE")

output = run_cli()

# In local
Expand Down

0 comments on commit 90c5bcd

Please sign in to comment.