Opened 2 years ago

Closed 2 years ago

#18326 closed Bug (fixed)

servers.LiveServerViews tests fail on windows due to line separator

Reported by: 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 manfre 2 years ago.

Download all attachments as: .zip

Change History (4)

Changed 2 years ago by manfre

comment:1 Changed 2 years ago by claudep

  • Needs documentation unset
  • Needs tests unset
  • Patch needs improvement unset
  • Triage Stage changed from Unreviewed to Accepted

Or use os.linesep?

comment:2 Changed 2 years ago by 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 2 years ago by Claude Paroz <claude@…>

  • Resolution set to fixed
  • Status changed from new to closed

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.

Add Comment

Modify Ticket

Change Properties
<Author field>
as closed
as The resolution will be set. Next status will be 'closed'
The resolution will be deleted. Next status will be 'new'

E-mail address and user name can be saved in the Preferences.

Note: See TracTickets for help on using tickets.