Skip to content

Commit

Permalink
sandbox mystery no file .gitattributes
Browse files Browse the repository at this point in the history
- test: file not found create a .gitattributes
  • Loading branch information
msftcangoblowm committed Aug 30, 2024
1 parent b00fd8f commit cc015fa
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
"""

import logging
import os
import os.path as osp
import platform
import re
Expand Down Expand Up @@ -468,7 +469,17 @@ def func(path_cwd):
path_f_dst = path_cwd / path_f_src.name
path_f_dst.touch()
assert path_f_dst.is_file()
shutil.copy2(path_f_src, path_f_dst)
if not path_f_src.exists():
# workflow "Run test suite in sandbox" fails to find .gitattributes
sep = os.linesep
contents = (
f"tests/resource/objects_mkdoc_zlib0.inv binary{sep}"
f"tests/resource/objects_attrs.txt binary{sep}"
f"*.inv binary diff=inv{sep}"
)
path_f_dst.write_text(contents)
else:
shutil.copy2(path_f_src, path_f_dst)
return path_f_dst

return func

0 comments on commit cc015fa

Please sign in to comment.