From 5e4b8999fcefd2301b516ce8e2900b09c758390d Mon Sep 17 00:00:00 2001 From: Eliah Kagan Date: Wed, 15 Nov 2023 20:17:51 -0500 Subject: [PATCH] Mark test_create_remote_unsafe_url_allowed xfail on Windows The test mostly works on Windows, but it fails because the tmp_file path is expected to appear in remote_url with backslash separators, but (forward) slashes appear instead. --- test/test_remote.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/test/test_remote.py b/test/test_remote.py index 711c7b1bc..f9f35e5d8 100644 --- a/test/test_remote.py +++ b/test/test_remote.py @@ -3,6 +3,7 @@ # This module is part of GitPython and is released under the # 3-Clause BSD License: https://opensource.org/license/bsd-3-clause/ +import os import os.path as osp from pathlib import Path import random @@ -767,6 +768,11 @@ def test_create_remote_unsafe_url(self, rw_repo): Remote.create(rw_repo, "origin", url) assert not tmp_file.exists() + @pytest.mark.xfail( + os.name == "nt", + reason=R"Multiple '\' instead of '/' in remote.url make it differ from expected value", + raises=AssertionError, + ) @with_rw_repo("HEAD") def test_create_remote_unsafe_url_allowed(self, rw_repo): with tempfile.TemporaryDirectory() as tdir: