Bug
tests/helpdesk/test_patch.py::TestMitigationPatch::test_applies_and_reverses_cleanly
fails on Windows because git apply converts LF to CRLF, causing a byte-level
mismatch when the test compares the reversed patch against the original file.
Reproduction
Windows 11, Python 3.13.5, Git with default core.autocrlf=true:
uv sync
uv run pytest tests/helpdesk/test_patch.py -v
Output: AssertionError: assert b'# Copyright...\r\n )\r\n' == b'# Copyright...rd],\n )\n'
At index 38 diff: b'\r' != b'\n'
Proposed fix
Add to .gitattributes: helpdesk-bot/mitigation.patch text eol=lf
Environment
- OS: Windows 11
- Python: 3.13.5
- Git: default autocrlf settings
Bug
tests/helpdesk/test_patch.py::TestMitigationPatch::test_applies_and_reverses_cleanlyfails on Windows because
git applyconverts LF to CRLF, causing a byte-levelmismatch when the test compares the reversed patch against the original file.
Reproduction
Windows 11, Python 3.13.5, Git with default
core.autocrlf=true:uv sync
uv run pytest tests/helpdesk/test_patch.py -v
Output: AssertionError: assert b'# Copyright...\r\n )\r\n' == b'# Copyright...rd],\n )\n'
At index 38 diff: b'\r' != b'\n'
Proposed fix
Add to
.gitattributes: helpdesk-bot/mitigation.patch text eol=lfEnvironment