fix(tests): write CRLF CSV fixtures byte-exact on Windows - #175
Open
dieterolson wants to merge 1 commit into
Open
fix(tests): write CRLF CSV fixtures byte-exact on Windows#175dieterolson wants to merge 1 commit into
dieterolson wants to merge 1 commit into
Conversation
Path.write_text default newline translation turns the embedded \r\n in the TrackMan CSV fixtures into \r\r\n on Windows, so the BOM/sep preamble test parsed 0 shots. newline="" preserves the fixture content on every platform.
5 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What does this PR do?
Adds
newline=""to the two CRLF CSV fixture writes intests/test_compare_trackman.pyso the fixture bytes reach disk exactly as written on every platform.Why was this required?
Path.write_textapplies default newline translation ("\n"→os.linesep), which turns the fixtures' embedded\r\ninto\r\r\non Windows. The BOM/sep=preamble test (test_handles_excel_sep_preamble_and_bom) then parses 0 shots instead of 2 and fails on every Windows checkout. These fixtures exist to reproduce what TrackMan actually exports, so they must be byte-exact;newline=""disables translation and is a no-op on POSIX.Automated tests
Test-only change — the module is the coverage:
tests/test_compare_trackman.pygoes from 34 passed / 1 failed to 35/35 on Windows; unchanged on Linux/macOS.Manual (human) testing
assert 0 == 2— zero shots parsed from the CRLF fixture)._write_trackman_csvhelper (which already usedopen(..., newline="")) that this matches the file's existing convention.Checklist
uv run pytest tests/ -v)uv run pylint src/openflight/ --fail-under=9)uv run ruff check src/openflight/)cd ui && npm run build) — not applicable, no UI changescd ui && npm run lint) — not applicable, no UI changes