[GRASS-git] [OSGeo/grass] 3d6d58: grass.gunittest: Preserve exact bytes in MD5 test ...

Edouard Choinière noreply at github.com
Fri Oct 9 14:27:37 PDT 2026


  Branch: refs/heads/main
  Home:   https://github.com/OSGeo/grass
  Commit: 3d6d5887bb19ce20e595e66dceec9703228ee712
      https://github.com/OSGeo/grass/commit/3d6d5887bb19ce20e595e66dceec9703228ee712
  Author: Edouard Choinière <27212526+echoix at users.noreply.github.com>
  Date:   2026-10-09 (Fri, 09 Oct 2026)

  Changed paths:
    M python/grass/gunittest/testsuite/test_assertions.py
    M python/grass/gunittest/testsuite/test_checkers.py

  Log Message:
  -----------
  grass.gunittest: Preserve exact bytes in MD5 test fixtures (#8039)

Python's default text-mode writing translates "\n" to os.linesep, which
on Windows turns the MD5 test fixtures into "\r\n" files. Two tests hash
them in binary mode against MD5 sums computed from "\n" content:
test_text_file_binary in test_checkers.py and test_assertFileMd5 in
test_assertions.py.

Write these fixtures with newline="" so the bytes match the hardcoded
sums on every platform. Do the same for the other fixtures written next
to file_with_md5, since test_assertFilesEqualMd5 compares their hashes
against it. Remove the now obsolete @xfail_windows markers from the two
tests, because an unexpected success makes the gunittest run fail.

Also fix the "platfrom" typos in the test_text_file_platform test name
and the platform_newline attribute.

Based on the newline handling in OSGeo/grass#2616 by Stefan Blumentrath,
reworked against current main with AI assistance.

Co-authored-by: Stefan Blumentrath <4246620+ninsbl at users.noreply.github.com>



To unsubscribe from these emails, change your notification settings at https://github.com/OSGeo/grass/settings/notifications


More information about the grass-commit mailing list