Skip to content

Commit

Permalink
chore: code maintenance (#949)
Browse files Browse the repository at this point in the history
Co-authored-by: pyansys-ci-bot <[email protected]>
  • Loading branch information
dipinknair and pyansys-ci-bot authored Oct 23, 2024
1 parent 267df7d commit 4153cc3
Show file tree
Hide file tree
Showing 6 changed files with 10 additions and 13 deletions.
4 changes: 2 additions & 2 deletions CODE_OF_CONDUCT.md
Original file line number Diff line number Diff line change
Expand Up @@ -57,9 +57,9 @@ further defined and clarified by project maintainers.

This Code of Conduct is adapted from the [Contributor Covenant][homepage],
version 1.4, available at
https://www.contributor-covenant.org/version/1/4/code-of-conduct.html
<https://www.contributor-covenant.org/version/1/4/code-of-conduct.html>

[homepage]: https://www.contributor-covenant.org

For answers to common questions about this code of conduct, see
https://www.contributor-covenant.org/faq
<https://www.contributor-covenant.org/faq>
1 change: 1 addition & 0 deletions doc/changelog.d/949.maintenance.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
code maintenance
1 change: 0 additions & 1 deletion src/ansys/mechanical/core/mechanical.py
Original file line number Diff line number Diff line change
Expand Up @@ -496,7 +496,6 @@ def version(self) -> str:
raise
finally:
self._disable_logging = False
pass
return self._version

@property
Expand Down
2 changes: 1 addition & 1 deletion src/ansys/mechanical/core/pool.py
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,7 @@ def __init__(
version = kwargs["version"]
self._remote = True
else:
raise "Pypim is configured. But version is not passed."
raise ValueError("Pypim is configured, but version is not passed.")
else: # get default executable
exec_file = get_mechanical_path()
if exec_file is None: # pragma: no cover
Expand Down
9 changes: 6 additions & 3 deletions tests/test_logging.py
Original file line number Diff line number Diff line change
Expand Up @@ -165,9 +165,12 @@ def test_global_logger_debug_mode():
@pytest.mark.remote_session_launch
def test_global_logger_exception_handling(caplog):
exc = "Unexpected exception"
with pytest.raises(Exception):
raise Exception(exc)
assert exc in caplog.text
with caplog.at_level(logging.ERROR):
with pytest.raises(Exception):
LOG.error(exc) # Log the exception before raising
raise Exception(exc)

assert exc in caplog.text


@pytest.mark.remote_session_launch
Expand Down
6 changes: 0 additions & 6 deletions tests/test_mechanical.py
Original file line number Diff line number Diff line change
Expand Up @@ -424,12 +424,6 @@ def test_close_all_Local_instances(tmpdir):
assert value not in pymechanical.LOCAL_PORTS


@pytest.mark.remote_session_launch
def test_launch_result_mode(mechanical_result):
result = mechanical_result.run_python_script("2+3")
assert result == "5"


@pytest.mark.remote_session_launch
def test_find_mechanical_path():
if pymechanical.mechanical.get_start_instance():
Expand Down

0 comments on commit 4153cc3

Please sign in to comment.