Skip to content

Commit 502c500

Browse files
StefanThoenepyansys-ci-botpluAtAnsys
authored
fix: sim export_unittest for windows (#655)
## Description Fix unittest of simulation export for windows systems ## Issue linked ## Checklist - [x] I have tested my changes locally. - [x] I have added necessary documentation or updated existing documentation. - [x] I have followed the coding style guidelines of this project. - [x] I have added appropriate tests (unit, integration, system). - [x] I have reviewed my changes before submitting this pull request. - [x] I have linked the issue or issues that are solved by the PR if any. - [x] I have assigned this PR to myself. - [x] I have made sure that the title of my PR follows [Conventional commits style](https://www.conventionalcommits.org/en/v1.0.0/#summary) (e.g. ``feat: add optical property``) - [x] I have agreed with the Contributor License Agreement ([CLA](https://developer.ansys.com/form/cla-acceptance)). --------- Co-authored-by: pyansys-ci-bot <[email protected]> Co-authored-by: Pengyuan LU <[email protected]>
1 parent 011c9ae commit 502c500

File tree

2 files changed

+11
-1
lines changed

2 files changed

+11
-1
lines changed

doc/changelog.d/655.fixed.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Sim export_unittest for windows

tests/helper.py

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -128,6 +128,15 @@ def remove_file(path):
128128
----------
129129
path (str) - path of the file.
130130
"""
131+
132+
def rmtree(f: Path):
133+
if f.is_file():
134+
f.unlink()
135+
else:
136+
for child in f.iterdir():
137+
rmtree(child)
138+
f.rmdir()
139+
131140
if config.get("SpeosServerOnDocker"):
132141
subprocess.call(
133142
"docker exec "
@@ -138,4 +147,4 @@ def remove_file(path):
138147
shell=True,
139148
)
140149
else:
141-
Path(path).unlink()
150+
rmtree(Path(path))

0 commit comments

Comments
 (0)