##// END OF EJS Templates
run-tests: pass temp dir into Test.__init__...
Gregory Szorc -
r21504:888a5dfe default
parent child Browse files
Show More
@@ -338,7 +338,7 b' class Test(unittest.TestCase):'
338 338 # Status code reserved for skipped tests (used by hghave).
339 339 SKIPPED_STATUS = 80
340 340
341 def __init__(self, runner, path, count):
341 def __init__(self, runner, path, count, tmpdir):
342 342 """Create a test from parameters.
343 343
344 344 runner is a TestRunner instance.
@@ -346,6 +346,8 b' class Test(unittest.TestCase):'
346 346 path is the full path to the file defining the test.
347 347
348 348 count is an identifier used to denote this test instance.
349
350 tmpdir is the main temporary directory to use for this test.
349 351 """
350 352
351 353 self._path = path
@@ -356,6 +358,7 b' class Test(unittest.TestCase):'
356 358 self._runner = runner
357 359 self._options = runner.options
358 360 self._count = count
361 self._threadtmp = tmpdir
359 362 self._daemonpids = []
360 363
361 364 self._finished = None
@@ -375,8 +378,6 b' class Test(unittest.TestCase):'
375 378 else:
376 379 self._refout = []
377 380
378 self._threadtmp = os.path.join(runner.hgtmp, 'child%d' % count)
379
380 381 def __str__(self):
381 382 return self.name
382 383
@@ -1467,7 +1468,10 b' class TestRunner(object):'
1467 1468 testcls = cls
1468 1469 break
1469 1470
1470 return testcls(self, os.path.join(self.testdir, test), count)
1471 refpath = os.path.join(self.testdir, test)
1472 tmpdir = os.path.join(self.hgtmp, 'child%d' % count)
1473
1474 return testcls(self, refpath, count, tmpdir)
1471 1475
1472 1476 def _cleanup(self):
1473 1477 """Clean up state from this test invocation."""
General Comments 0
You need to be logged in to leave comments. Login now