Skip to content

Commit 9d4c027

Browse files
committed
twister: reports: use Path instead of PosixPath
Directly instantiating a PosixPath is not allowed on Windows, use Path instead. Signed-off-by: Benjamin Cabé <[email protected]>
1 parent 216391b commit 9d4c027

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

scripts/pylib/twister/twisterlib/reports.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
import xml.etree.ElementTree as ET
1212
from datetime import datetime
1313
from enum import Enum
14-
from pathlib import PosixPath
14+
from pathlib import Path, PosixPath
1515

1616
from colorama import Fore
1717
from twisterlib.statuses import TwisterStatus
@@ -171,7 +171,7 @@ def xunit_report_suites(self, json_file, filename):
171171
runnable = suite.get('runnable', 0)
172172
duration += float(handler_time)
173173
ts_status = TwisterStatus(suite.get('status'))
174-
classname = PosixPath(suite.get("name","")).name
174+
classname = Path(suite.get("name","")).name
175175
for tc in suite.get("testcases", []):
176176
status = TwisterStatus(tc.get('status'))
177177
reason = tc.get('reason', suite.get('reason', 'Unknown'))
@@ -253,7 +253,7 @@ def xunit_report(self, json_file, filename, selected_platform=None, full_report=
253253
):
254254
continue
255255
if full_report:
256-
classname = PosixPath(ts.get("name","")).name
256+
classname = Path(ts.get("name","")).name
257257
for tc in ts.get("testcases", []):
258258
status = TwisterStatus(tc.get('status'))
259259
reason = tc.get('reason', ts.get('reason', 'Unknown'))

0 commit comments

Comments
 (0)