comparison tests/run-tests.py @ 35204:f12747de13ea

run-tests: simplify by using dict.pop() with default Differential Revision: https://phab.mercurial-scm.org/D1573
author Martin von Zweigbergk <martinvonz@google.com>
date Fri, 01 Dec 2017 12:27:28 -0800
parents bd8875b6473c
children 779c6cf2967b
comparison
equal deleted inserted replaced
35203:d8d06a930d60 35204:f12747de13ea
1216 ESCAPEMAP = dict((bchr(i), br'\x%02x' % i) for i in range(256)) 1216 ESCAPEMAP = dict((bchr(i), br'\x%02x' % i) for i in range(256))
1217 ESCAPEMAP.update({b'\\': b'\\\\', b'\r': br'\r'}) 1217 ESCAPEMAP.update({b'\\': b'\\\\', b'\r': br'\r'})
1218 1218
1219 def __init__(self, path, *args, **kwds): 1219 def __init__(self, path, *args, **kwds):
1220 # accept an extra "case" parameter 1220 # accept an extra "case" parameter
1221 case = None 1221 case = kwds.pop('case', None)
1222 if 'case' in kwds:
1223 case = kwds.pop('case')
1224 self._case = case 1222 self._case = case
1225 self._allcases = parsettestcases(path) 1223 self._allcases = parsettestcases(path)
1226 super(TTest, self).__init__(path, *args, **kwds) 1224 super(TTest, self).__init__(path, *args, **kwds)
1227 if case: 1225 if case:
1228 self.name = '%s (case %s)' % (self.name, _strpath(case)) 1226 self.name = '%s (case %s)' % (self.name, _strpath(case))