From 50206d44dc1b0dccd595e873136ea8779ffa8f91 Mon Sep 17 00:00:00 2001 From: Saugat Pachhai Date: Thu, 16 Jan 2020 21:06:52 +0545 Subject: [PATCH] test: fix test related to path on windows On windows, `str(exc_info)` is returning escaped path, eg: '' This commit just replaces the double slashes with single one. Bit of a hack, I know. --- tests/func/test_api.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tests/func/test_api.py b/tests/func/test_api.py index 41cd0f743..b3f0c0aba 100644 --- a/tests/func/test_api.py +++ b/tests/func/test_api.py @@ -57,7 +57,8 @@ def test_get_url_git_only_repo_throws_exception(tmp_dir, scm): with pytest.raises(UrlNotDvcRepoError) as exc_info: api.get_url("foo", fspath(tmp_dir)) - assert fspath(tmp_dir) in str(exc_info) + # On windows, `exc_info` has path escaped, eg: `C:\\\\Users\\\\travis` + assert fspath(tmp_dir) in str(exc_info).replace("\\\\", "\\") @pytest.mark.parametrize("remote_url", all_remote_params, indirect=True)