mirror of
https://github.com/httprunner/httprunner.git
synced 2026-06-07 08:49:37 +08:00
fix: compatibility with different path separators of Linux and Windows
This commit is contained in:
@@ -348,3 +348,15 @@ def session_fixture(request):
|
||||
f.write(conftest_content)
|
||||
|
||||
logger.info("generated conftest.py to generate summary.json")
|
||||
|
||||
|
||||
def ensure_path_sep(path: Text) -> Text:
|
||||
""" ensure compatibility with different path separators of Linux and Windows
|
||||
"""
|
||||
if "/" in path:
|
||||
path = os.sep.join(path.split("/"))
|
||||
|
||||
if "\\" in path:
|
||||
path = os.sep.join(path.split("\\"))
|
||||
|
||||
return path
|
||||
|
||||
Reference in New Issue
Block a user