Opened 6 years ago

Closed 6 years ago

#18326 closed Bug (fixed)

servers.LiveServerViews tests fail on windows due to line separator

Reported by: Michael Manfre Owned by: nobody
Component: Testing framework Version: master
Severity: Normal Keywords:
Cc: Triage Stage: Accepted
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no


The tests servers.LiveServerViews.test_static_files and servers.LiveServerViews.test_media_files are explicitly looking for '\n'. The test fails on windows with git autocrlf, which translates the read files to end with '\r\n'.

Attachments (1)

django-ticket18326.diff (882 bytes) - added by Michael Manfre 6 years ago.

Download all attachments as: .zip

Change History (4)

Changed 6 years ago by Michael Manfre

Attachment: django-ticket18326.diff added

comment:1 Changed 6 years ago by Claude Paroz

Triage Stage: UnreviewedAccepted

Or use os.linesep?

comment:2 Changed 6 years ago by Michael Manfre

Depending on the git crlf setting, it's possible that os.linesep will not match the line separators used in the file, which is why I chose to strip them all.

comment:3 Changed 6 years ago by Claude Paroz <claude@…>

Resolution: fixed
Status: newclosed

In [006c2b8fc166e53d4ffccda9c42ef9fc109e1c8d]:

Fixed #18326 -- Stripped ending chars in LiveServerViews tests.

Ending chars might be different depending on git crlf setting.
Thanks Michael Manfre for the report and the patch.

Note: See TracTickets for help on using tickets.
Back to Top