Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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