##// END OF EJS Templates
run-tests: use bytes explicitly for tmpdir and hgrc construction...
Augie Fackler -
r25034:af6e6a07 default
parent child Browse files
Show More
@@ -430,12 +430,12 b' class Test(unittest.TestCase):'
430 shell is the shell to execute tests in.
430 shell is the shell to execute tests in.
431 """
431 """
432
432
433 self.path = path
433 self.path = path.encode('utf-8')
434 self.name = os.path.basename(path)
434 self.name = os.path.basename(path)
435 self._testdir = os.path.dirname(path)
435 self._testdir = os.path.dirname(path)
436 self.errpath = os.path.join(self._testdir, '%s.err' % self.name)
436 self.errpath = os.path.join(self._testdir, '%s.err' % self.name)
437
437
438 self._threadtmp = tmpdir
438 self._threadtmp = tmpdir.encode('utf-8')
439 self._keeptmpdir = keeptmpdir
439 self._keeptmpdir = keeptmpdir
440 self._debug = debug
440 self._debug = debug
441 self._timeout = timeout
441 self._timeout = timeout
@@ -689,8 +689,8 b' class Test(unittest.TestCase):'
689 env["HGPORT"] = str(self._startport)
689 env["HGPORT"] = str(self._startport)
690 env["HGPORT1"] = str(self._startport + 1)
690 env["HGPORT1"] = str(self._startport + 1)
691 env["HGPORT2"] = str(self._startport + 2)
691 env["HGPORT2"] = str(self._startport + 2)
692 env["HGRCPATH"] = os.path.join(self._threadtmp, '.hgrc')
692 env["HGRCPATH"] = os.path.join(self._threadtmp, b'.hgrc')
693 env["DAEMON_PIDS"] = os.path.join(self._threadtmp, 'daemon.pids')
693 env["DAEMON_PIDS"] = os.path.join(self._threadtmp, b'daemon.pids')
694 env["HGEDITOR"] = ('"' + sys.executable + '"'
694 env["HGEDITOR"] = ('"' + sys.executable + '"'
695 + ' -c "import sys; sys.exit(0)"')
695 + ' -c "import sys; sys.exit(0)"')
696 env["HGMERGE"] = "internal:merge"
696 env["HGMERGE"] = "internal:merge"
@@ -721,27 +721,27 b' class Test(unittest.TestCase):'
721 def _createhgrc(self, path):
721 def _createhgrc(self, path):
722 """Create an hgrc file for this test."""
722 """Create an hgrc file for this test."""
723 hgrc = open(path, 'wb')
723 hgrc = open(path, 'wb')
724 hgrc.write('[ui]\n')
724 hgrc.write(b'[ui]\n')
725 hgrc.write('slash = True\n')
725 hgrc.write(b'slash = True\n')
726 hgrc.write('interactive = False\n')
726 hgrc.write(b'interactive = False\n')
727 hgrc.write('mergemarkers = detailed\n')
727 hgrc.write(b'mergemarkers = detailed\n')
728 hgrc.write('promptecho = True\n')
728 hgrc.write(b'promptecho = True\n')
729 hgrc.write('[defaults]\n')
729 hgrc.write(b'[defaults]\n')
730 hgrc.write('backout = -d "0 0"\n')
730 hgrc.write(b'backout = -d "0 0"\n')
731 hgrc.write('commit = -d "0 0"\n')
731 hgrc.write(b'commit = -d "0 0"\n')
732 hgrc.write('shelve = --date "0 0"\n')
732 hgrc.write(b'shelve = --date "0 0"\n')
733 hgrc.write('tag = -d "0 0"\n')
733 hgrc.write(b'tag = -d "0 0"\n')
734 hgrc.write('[devel]\n')
734 hgrc.write(b'[devel]\n')
735 hgrc.write('all = true\n')
735 hgrc.write(b'all = true\n')
736 hgrc.write('[largefiles]\n')
736 hgrc.write(b'[largefiles]\n')
737 hgrc.write('usercache = %s\n' %
737 hgrc.write(b'usercache = %s\n' %
738 (os.path.join(self._testtmp, '.cache/largefiles')))
738 (os.path.join(self._testtmp, b'.cache/largefiles')))
739
739
740 for opt in self._extraconfigopts:
740 for opt in self._extraconfigopts:
741 section, key = opt.split('.', 1)
741 section, key = opt.split('.', 1)
742 assert '=' in key, ('extra config opt %s must '
742 assert '=' in key, ('extra config opt %s must '
743 'have an = for assignment' % opt)
743 'have an = for assignment' % opt)
744 hgrc.write('[%s]\n%s\n' % (section, key))
744 hgrc.write(b'[%s]\n%s\n' % (section, key))
745 hgrc.close()
745 hgrc.close()
746
746
747 def fail(self, msg):
747 def fail(self, msg):
General Comments 0
You need to be logged in to leave comments. Login now