mirror of
https://github.com/Stone-Red-Code/dvc.git
synced 2026-11-02 07:18:25 +01:00
test: fix test related to path on windows
On windows, `str(exc_info)` is returning escaped path, eg:
'<ExceptionInfo UrlNotDvcRepoError("URL \'C:\\\\Users\\\\travis\\\\AppData\\\\Local\\\\Temp\\\\pytest-of-travis\\\\pytest-0\\\\popen-gw2\\\\test_get_url_git_only_repo_thr0\' is not a dvc repository.") tblen=2>'
This commit just replaces the double slashes with single one. Bit of a hack, I know.
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user