Skip to content

Commit

Permalink
some codecov complains
Browse files Browse the repository at this point in the history
  • Loading branch information
germa89 committed Dec 26, 2023
1 parent 773ddb7 commit 5ee4d22
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions src/ansys/mapdl/core/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -481,15 +481,15 @@ def start(
default=False,
help="Kill all MAPDL instances",
)
def stop(port, pid, all):
def stop(port, pid, all_ports):
if not pid and not port:
port = 50052

Check warning on line 486 in src/ansys/mapdl/core/cli.py

View check run for this annotation

Codecov / codecov/patch

src/ansys/mapdl/core/cli.py#L485-L486

Added lines #L485 - L486 were not covered by tests

if port or all:
if port or all_ports:
killed_ = False
for proc in psutil.process_iter():
for conns in proc.connections(kind="inet"):
if (conns.laddr.port == port or all) and (
if (conns.laddr.port == port or all_ports) and (

Check warning on line 492 in src/ansys/mapdl/core/cli.py

View check run for this annotation

Codecov / codecov/patch

src/ansys/mapdl/core/cli.py#L488-L492

Added lines #L488 - L492 were not covered by tests
"ansys" in proc.name().lower() or "mapdl" in proc.name().lower()
):
killed_ = True
Expand All @@ -498,22 +498,22 @@ def stop(port, pid, all):
except psutil.NoSuchProcess:

Check warning on line 498 in src/ansys/mapdl/core/cli.py

View check run for this annotation

Codecov / codecov/patch

src/ansys/mapdl/core/cli.py#L495-L498

Added lines #L495 - L498 were not covered by tests
# Cases where the child process has already died.
pass
if all:
str_ = f""
if all_ports:
str_ = ""

Check warning on line 502 in src/ansys/mapdl/core/cli.py

View check run for this annotation

Codecov / codecov/patch

src/ansys/mapdl/core/cli.py#L500-L502

Added lines #L500 - L502 were not covered by tests
else:
str_ = f" running on port {port}"

Check warning on line 504 in src/ansys/mapdl/core/cli.py

View check run for this annotation

Codecov / codecov/patch

src/ansys/mapdl/core/cli.py#L504

Added line #L504 was not covered by tests

if not killed_:
click.echo(

Check warning on line 507 in src/ansys/mapdl/core/cli.py

View check run for this annotation

Codecov / codecov/patch

src/ansys/mapdl/core/cli.py#L506-L507

Added lines #L506 - L507 were not covered by tests
click.style("ERROR: ", fg="red")
+ f"No Ansys instances"
+ "No Ansys instances"
+ str_
+ "have been found."
)
else:
click.echo(

Check warning on line 514 in src/ansys/mapdl/core/cli.py

View check run for this annotation

Codecov / codecov/patch

src/ansys/mapdl/core/cli.py#L514

Added line #L514 was not covered by tests
click.style("Success: ", fg="green")
+ f"Ansys instances"
+ "Ansys instances"
+ str_
+ " have been stopped."
)
Expand Down

0 comments on commit 5ee4d22

Please sign in to comment.