Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
18 commits
Select commit Hold shift + click to select a range
2dc1180
fix: conditionally handle extra instances during test teardown
germa89 Feb 18, 2026
1a3e0f7
build: update ansys-tools-visualization-interface version constraint
germa89 Feb 18, 2026
0ea76c5
fix: reusing objects in defaults
germa89 Feb 18, 2026
a6c0aa0
Merge branch 'main' into tests/improving-tests-performance
germa89 Feb 18, 2026
365dd14
chore: adding changelog file 4425.test.md [dependabot-skip]
pyansys-ci-bot Feb 18, 2026
e1a1992
Merge branch 'main' into tests/improving-tests-performance
clatapie Feb 18, 2026
103b012
chore: merge remote-tracking branch 'origin/main' into tests/improvin…
germa89 Feb 18, 2026
b5405d6
fix: some tests
germa89 Feb 18, 2026
57aff99
Merge branch 'tests/improving-tests-performance' of https://github.co…
germa89 Feb 18, 2026
b5b3da7
fix: update platform attribute access in _wrap_directory method
germa89 Feb 19, 2026
a83e6ce
fix: improve directory path handling in test_cwd and clean up in test…
germa89 Feb 19, 2026
9670608
test: skip test_remove_temp_dir_on_exit_with_launch_mapdl for now
germa89 Feb 19, 2026
633a9e1
refactor: update test functions to use new clear fixtures for improve…
germa89 Feb 19, 2026
3b4fe06
refactor: update test functions to use clear_at_end fixture for consi…
germa89 Feb 19, 2026
3424246
refactor: update test functions to use clear_at_end fixture for consi…
germa89 Feb 19, 2026
b81f2f4
refactor: simplify assertions in test_lgwrite for clarity
germa89 Feb 20, 2026
e5c8d44
Merge branch 'main' into tests/improving-tests-performance
germa89 Feb 20, 2026
afa4fac
Merge branch 'tests/improving-tests-performance' of https://github.co…
germa89 Feb 20, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions doc/changelog.d/4425.test.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Improving tests performance
8 changes: 4 additions & 4 deletions src/ansys/mapdl/core/mapdl_core.py
Original file line number Diff line number Diff line change
Expand Up @@ -554,20 +554,20 @@ def default_file_type_for_plots(self, value: VALID_FILE_TYPE_FOR_PLOT_LITERAL):
return self._default_file_type_for_plots

def _wrap_directory(self, path: Union[str, pathlib.Path]) -> pathlib.PurePath:
if self._platform is None:
if self.platform is None:
# MAPDL is not initialized yet so returning the path as is.
return pathlib.PurePath(path)

if self._platform == "windows":
if self.platform == "windows":
# Windows path
return pathlib.PureWindowsPath(path)
elif self._platform == "linux":
elif self.platform == "linux":
# Linux path
return pathlib.PurePosixPath(path)
else:
# Other OS path
warn(
f"MAPDL is running on an unknown OS '{self._platform}'. "
f"MAPDL is running on an unknown OS '{self.platform}'. "
"Using PurePosixPath as default.",
UserWarning,
)
Expand Down
2 changes: 1 addition & 1 deletion src/ansys/mapdl/core/plotting/plotting_defaults.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ def __init__(self):
self._configured = False

def __call__(self, name):
if True: # not self._configured: # Temporal patch pending on #3568
if not self._configured: # Temporal patch pending on #3568
self._set_configuration()
Comment on lines +74 to 75
Copy link

Copilot AI Feb 18, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The inline note says this is a “Temporal patch pending on #3568”, but this PR is marked to close #3568. If the issue is now resolved, this comment should be updated/removed; if it’s not resolved, the PR description/linking should be adjusted because this change reverts the prior mitigation.

Copilot uses AI. Check for mistakes.
self._configured = True
Comment on lines +74 to 76
Copy link

Copilot AI Feb 18, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There’s no regression coverage around the behavior that prompted #3568 (glyphs/legend geometry drifting across calls/tests). Since this change alters caching semantics, adding a test that exercises repeated BC plotting/legend creation and asserts glyph geometry stays stable would help prevent reintroducing the flakiness.

Copilot uses AI. Check for mistakes.

Expand Down
35 changes: 25 additions & 10 deletions tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -588,8 +588,9 @@ def run_before_and_after_tests(
# Returning to default
mapdl.graphics("full")

# Handling extra instances
make_sure_not_instances_are_left_open(VALID_PORTS)
if DEBUG_TESTING:
# Handling extra instances
make_sure_not_instances_are_left_open(VALID_PORTS)

# Teardown
if mapdl.is_local and mapdl._exited:
Expand Down Expand Up @@ -638,15 +639,16 @@ def path_tests(tmpdir):


def clear(mapdl):
mapdl.finish()
# *MUST* be NOSTART. With START fails after 20 calls...
# this has been fixed in later pymapdl and MAPDL releases
mapdl.clear("NOSTART")
mapdl.header("DEFA")
mapdl.format("DEFA")
mapdl.page("DEFA")
with mapdl.non_interactive:
mapdl.finish()
# *MUST* be NOSTART. With START fails after 20 calls...
# this has been fixed in later pymapdl and MAPDL releases
mapdl.clear("NOSTART")
mapdl.header("DEFA")
mapdl.format("DEFA")
mapdl.page("DEFA")

mapdl.prep7()
mapdl.prep7()


@pytest.fixture(scope="function")
Expand All @@ -655,6 +657,19 @@ def cleared(mapdl):
yield


@pytest.fixture(scope="function")
def clear_at_end(mapdl):
yield
clear(mapdl)


@pytest.fixture(scope="function")
def clear_at_start_and_end(mapdl):
clear(mapdl)
yield
clear(mapdl)


################################################################
#
# Setting interface fixtures
Expand Down
Loading
Loading