diff options
author | Robert Collins <robertc@robertcollins.net> | 2013-04-13 22:18:27 +1200 |
---|---|---|
committer | Robert Collins <robertc@robertcollins.net> | 2013-04-13 22:18:27 +1200 |
commit | e6fa368625b8319c860a06f72cd52d4326db36c4 (patch) | |
tree | f1133084d259b8b990981a4741625635ee5aa1a3 | |
parent | b1170816e23a7525bbc41729096d6121f4ba52f5 (diff) | |
download | testrepository-e6fa368625b8319c860a06f72cd52d4326db36c4.tar.gz |
Simplify load a little.
-rw-r--r-- | testrepository/commands/load.py | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/testrepository/commands/load.py b/testrepository/commands/load.py index a925617..3ba05ff 100644 --- a/testrepository/commands/load.py +++ b/testrepository/commands/load.py @@ -75,11 +75,10 @@ class load(Command): # is to be an input stream. if self.ui.arguments.get('streams'): opener = partial(open, mode='rb') - cases = lambda:map(opener, self.ui.arguments['streams']) + streams = map(opener, self.ui.arguments['streams']) else: - cases = lambda:self.ui.iter_streams('subunit') - def make_tests(suite): - streams = list(suite) + streams = self.ui.iter_streams('subunit') + def make_tests(): for pos, stream in enumerate(streams): if v2_avail: # Calls StreamResult API. @@ -104,7 +103,7 @@ class load(Command): lambda result:testtools.StreamTagger( [result], add=['worker-%d' % pos])) yield (case, str(pos)) - case = testtools.ConcurrentStreamTestSuite(lambda: list(make_tests(cases()))) + case = testtools.ConcurrentStreamTestSuite(make_tests) # One unmodified copy of the stream to repository storage inserter = repo.get_inserter(partial=self.ui.options.partial) # One copy of the stream to the UI layer after performing global |