Skip to content

Commit 6f3baa1

Browse files
committed
fix: Test correction for Windows
1 parent 0a914af commit 6f3baa1

File tree

1 file changed

+4
-12
lines changed

1 file changed

+4
-12
lines changed

tests/test_inprocess.py

Lines changed: 4 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -108,11 +108,6 @@ def run(self, cmds: str) -> str | None:
108108
"MAPDL executable path must be an absolute path to an existing file."
109109
)
110110

111-
if self.version == 25.2:
112-
env = {"MAPDL_PYTHON_ENV": os.getenv("MAPDL_PYTHON_ENV", sys.prefix)}
113-
else:
114-
env = {}
115-
116111
try:
117112
args = [
118113
exec_path,
@@ -121,18 +116,16 @@ def run(self, cmds: str) -> str | None:
121116
"input.mac",
122117
"-o",
123118
"out.out",
124-
os.getenv("PYMAPDL_ADDITIONAL_SWITCHES", ""),
125119
]
126120

127121
self.completed_process = subprocess.run(
128122
args=args,
129123
cwd=self.wdir,
130124
check=True,
131125
capture_output=True,
132-
env=env,
133-
# it does not support shell=True, because it does not
134-
# generate the out.out file
135-
# TODO: Why shell should be false in order to generate the output file?
126+
# # it does not support shell=True, because it does not
127+
# # generate the out.out file
128+
# # TODO: Why shell should be false in order to generate the output file?
136129
shell=False, # nosec B603
137130
)
138131

@@ -183,10 +176,9 @@ def test_python_path(mapdl_inprocess: MapdlInProcessRunner):
183176
"""
184177
output_content = mapdl_inprocess.run(cmds)
185178
assert mapdl_inprocess.status_code == 0
186-
187179
assert output_content is not None
188180
assert "Testing Python path" in output_content
189-
assert sys.executable in output_content
181+
assert sys.executable.replace('\\\\', '\\').lower() in output_content.lower()
190182
assert "test ends" in output_content
191183

192184

0 commit comments

Comments
 (0)