diff tests/run-tests.py @ 35189:073843b5e353

run-tests: make --extra-config-opt work with Python 3 And add test coverage to ensure it works. Differential Revision: https://phab.mercurial-scm.org/D1476
author Gregory Szorc <gregory.szorc@gmail.com>
date Mon, 20 Nov 2017 21:26:11 -0800
parents d997b82152e8
children bd8875b6473c
line wrap: on
line diff
--- a/tests/run-tests.py	Mon Nov 20 21:08:18 2017 -0800
+++ b/tests/run-tests.py	Mon Nov 20 21:26:11 2017 -0800
@@ -1105,9 +1105,9 @@
         hgrc.write(b'ipv6 = %s\n' % str(self._useipv6).encode('ascii'))
 
         for opt in self._extraconfigopts:
-            section, key = opt.split('.', 1)
-            assert '=' in key, ('extra config opt %s must '
-                                'have an = for assignment' % opt)
+            section, key = opt.encode('utf-8').split(b'.', 1)
+            assert b'=' in key, ('extra config opt %s must '
+                                 'have an = for assignment' % opt)
             hgrc.write(b'[%s]\n%s\n' % (section, key))
         hgrc.close()