commit d6b660f6d245763ea10c4cc2f49a425fce7b8d59 Author: Damian Johnson atagar@torproject.org Date: Fri Mar 10 10:38:36 2017 -0800
Start integ tor process via keyword arguments
Bit more future proof, in addition to being more readable. --- test/runner.py | 17 +++++++---------- 1 file changed, 7 insertions(+), 10 deletions(-)
diff --git a/test/runner.py b/test/runner.py index a5d39d6..7c98d58 100644 --- a/test/runner.py +++ b/test/runner.py @@ -681,16 +681,13 @@ class Runner(object): start_time = time.time()
try: - # wait to fully complete if we're running tests with network activity, - # otherwise finish after local bootstraping - - complete_percent = 100 if Target.ONLINE in self.attribute_targets else 5 - - def print_init_line(line): - println(' %s' % line, SUBSTATUS) - - torrc_dst = os.path.join(self._test_dir, 'torrc') - self._tor_process = stem.process.launch_tor(tor_cmd, None, torrc_dst, complete_percent, print_init_line, take_ownership = True) + self._tor_process = stem.process.launch_tor( + tor_cmd = tor_cmd, + torrc_path = os.path.join(self._test_dir, 'torrc'), + completion_percent = 100 if Target.ONLINE in self.attribute_targets else 5, + init_msg_handler = lambda line: println(' %s' % line, SUBSTATUS), + take_ownership = True, + )
runtime = time.time() - start_time println(' done (%i seconds)\n' % runtime, STATUS)