[GRASS-SVN] r74406 - in grass/trunk/lib/python/gunittest: . testsuite

svn_grass at osgeo.org svn_grass at osgeo.org
Sat Apr 20 02:16:40 PDT 2019


Author: neteler
Date: 2019-04-20 02:16:40 -0700 (Sat, 20 Apr 2019)
New Revision: 74406

Modified:
   grass/trunk/lib/python/gunittest/checkers.py
   grass/trunk/lib/python/gunittest/testsuite/test_checkers.py
Log:
testsuite:  gunnitest.test_checkers update for Python3 (fixes #3821) (contributed by pmav99)

Modified: grass/trunk/lib/python/gunittest/checkers.py
===================================================================
--- grass/trunk/lib/python/gunittest/checkers.py	2019-04-19 15:23:23 UTC (rev 74405)
+++ grass/trunk/lib/python/gunittest/checkers.py	2019-04-20 09:16:40 UTC (rev 74406)
@@ -603,7 +603,7 @@
                 continue
             if exclude_re and regexp.match(line):
                 continue
-            hasher.update(line)
+            hasher.update(line.encode("utf-8"))
     if append_lines:
         for line in append_lines:
             hasher.update(line)

Modified: grass/trunk/lib/python/gunittest/testsuite/test_checkers.py
===================================================================
--- grass/trunk/lib/python/gunittest/testsuite/test_checkers.py	2019-04-19 15:23:23 UTC (rev 74405)
+++ grass/trunk/lib/python/gunittest/testsuite/test_checkers.py	2019-04-20 09:16:40 UTC (rev 74406)
@@ -190,9 +190,9 @@
         # although it does not support stripping (we don't merge separators)
         keyvals = text_to_keyvalue("a 1 2 3", sep=' ', val_sep=' ')
         self.assertDictEqual({'a': [1, 2, 3]}, keyvals)
-        
+
     #def test_projection_files(self):
-        
+
 # obtained by r.univar elevation -g
 # floats removed
 R_UNIVAR_KEYVAL = """n=2025000
@@ -354,7 +354,7 @@
             for line in CORRECT_LINES:
                 # \n should be converted to platform newline
                 f.write(line + '\n')
-        with open(cls.correct_file_name_unix_nl, 'wb') as f:
+        with open(cls.correct_file_name_unix_nl, 'w') as f:
             for line in CORRECT_LINES:
                 # binary mode will write pure \n
                 f.write(line + '\n')



More information about the grass-commit mailing list