pytest-datafiles
pytest-datafiles copied to clipboard
mode bits are not copied
Mode bits are not copied by default (https://py.readthedocs.io/en/latest/path.html#py._path.local.LocalPath.copy). This results in unexpected modes in testing. It would be useful if there were some way to use the datafiles fixture and copy modes.
That is indeed unfortunate. My gut reaction would be to set 'mode' and 'stat' to True.
If mode is True, will copy copy permission from path to target. If stat is True, copy permission, last modification time, last access time, and flags from path to target.
But that would of course be kind of a breaking change in case someone is relying on the current behaviour. To copy as exactly as possible seems more natural to me and not copying the mode bits was definitely never intended. Any thoughts anyone?