Visitar URL original
Fixing tests on Windows by icegreentea · Pull Request #1101 · python-openxml/python-docx · GitHub
The Wayback Machine - https://web.archive.org/web/20260215084832/https://github.com/python-openxml/python-docx/pull/1101
Skip to content

Fixing tests on Windows#1101

Open
icegreentea wants to merge 1 commit intopython-openxml:masterfrom
icegreentea:tests-line-ending-fix
Open

Fixing tests on Windows#1101
icegreentea wants to merge 1 commit intopython-openxml:masterfrom
icegreentea:tests-line-ending-fix

Conversation

@icegreentea
Copy link

Tests currently fail on Windows (see attached logs) depending on git's auto line ending settings.

The tests that fail are ones that read from test files that contain WIndows line endings (\r\n) and then compare the output against a pre-computed expected hash. Those hashes are computed against Unix line-ending versions (presumably, whoever author and runs these tests are using Unix line endings and has git configured to auto line-endings).

Fixed locally in test cases and test utils by normalizing endings before comparisons. I focused the changes to the test cases and utils (instead of actual code) because I don't think the code should be changing line endings in the background.

windows.log

Various test cases read from files that are Windows line-ending encoded.
These tests work on Linux probably because of git line-ending
normalization, but they fail on Windows.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant