Mercurial > hg
comparison 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 |
comparison
equal
deleted
inserted
replaced
35188:d997b82152e8 | 35189:073843b5e353 |
---|---|
1103 hgrc.write(b'[web]\n') | 1103 hgrc.write(b'[web]\n') |
1104 hgrc.write(b'address = localhost\n') | 1104 hgrc.write(b'address = localhost\n') |
1105 hgrc.write(b'ipv6 = %s\n' % str(self._useipv6).encode('ascii')) | 1105 hgrc.write(b'ipv6 = %s\n' % str(self._useipv6).encode('ascii')) |
1106 | 1106 |
1107 for opt in self._extraconfigopts: | 1107 for opt in self._extraconfigopts: |
1108 section, key = opt.split('.', 1) | 1108 section, key = opt.encode('utf-8').split(b'.', 1) |
1109 assert '=' in key, ('extra config opt %s must ' | 1109 assert b'=' in key, ('extra config opt %s must ' |
1110 'have an = for assignment' % opt) | 1110 'have an = for assignment' % opt) |
1111 hgrc.write(b'[%s]\n%s\n' % (section, key)) | 1111 hgrc.write(b'[%s]\n%s\n' % (section, key)) |
1112 hgrc.close() | 1112 hgrc.close() |
1113 | 1113 |
1114 def fail(self, msg): | 1114 def fail(self, msg): |
1115 # unittest differentiates between errored and failed. | 1115 # unittest differentiates between errored and failed. |