From b77a40ad446b63af59d9307d61ea62a7eefa8efd Mon Sep 17 00:00:00 2001 From: hp310780 <43389959+hp310780@users.noreply.github.com> Date: Tue, 26 Oct 2021 12:46:42 +0100 Subject: [PATCH] Update reporting locationline test to be OS agnostic --- testing/logging/test_reporting.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/testing/logging/test_reporting.py b/testing/logging/test_reporting.py index bea224510..ba2ee771e 100644 --- a/testing/logging/test_reporting.py +++ b/testing/logging/test_reporting.py @@ -1172,9 +1172,11 @@ def test_locationline_returns_best_relative_location(pytester: Pytester) -> None item.config.option.verbose = 2 tr = TerminalReporter(item.config) - fspath = f"{pytester.path}/unique/path" + path_to_test = os.path.join("unique", "path") + fspath = os.path.join(pytester.path, path_to_test) nodeid = "nodeid::test" + result = tr._locationline(nodeid, fspath, 1, "domain") - expected_result = f"{nodeid} <- unique/path " + expected_result = f"{nodeid} <- {path_to_test} " assert result == expected_result