diff --git a/tests/func/test_add.py b/tests/func/test_add.py index b1d639e49..f1e293641 100644 --- a/tests/func/test_add.py +++ b/tests/func/test_add.py @@ -637,8 +637,14 @@ def test_should_protect_on_repeated_add(link, dvc_repo, repo_dir): def test_escape_gitignore_entries(git, dvc_repo, repo_dir): - fname = "file!with*weird#naming_[1].txt" - ignored_fname = r"/file\!with\*weird\#naming_\[1\].txt" + fname = "file!with*weird#naming_[1].t?t" + ignored_fname = r"/file\!with\*weird\#naming_\[1\].t\?t" + + if os.name == "nt": + # Some characters are not supported by Windows in the filename + # https://docs.microsoft.com/en-us/windows/win32/fileio/naming-a-file + fname = "file!with_weird#naming_[1].txt" + ignored_fname = r"/file\!with_weird\#naming_\[1\].txt" os.rename(repo_dir.FOO, fname)