/brz/remove-bazaar

To get this branch, use:
bzr branch http://gegoxaren.bato24.eu/bzr/brz/remove-bazaar

« back to all changes in this revision

Viewing changes to breezy/tests/__init__.py

  • Committer: Martin
  • Date: 2017-06-05 23:15:32 UTC
  • mto: This revision was merged to the branch mainline in revision 6659.
  • Revision ID: gzlist@googlemail.com-20170605231532-duzdyvwyvdqwfvzv
Nibble away at getting test_selftest to pass on Python 3

Show diffs side-by-side

added added

removed removed

Lines of Context:
29
29
import difflib
30
30
import doctest
31
31
import errno
 
32
import functools
32
33
import itertools
33
34
import logging
34
35
import math
4211
4212
 
4212
4213
    It is safe to pass scenario generators or iterators.
4213
4214
 
4214
 
    :returns: A list of compound scenarios: the cross-product of all 
 
4215
    :returns: A list of compound scenarios: the cross-product of all
4215
4216
        scenarios, with the names concatenated and the parameters
4216
4217
        merged together.
4217
4218
    """
4218
 
    return reduce(_multiply_two_scenarios, map(list, scenarios))
 
4219
    return functools.reduce(_multiply_two_scenarios, map(list, scenarios))
4219
4220
 
4220
4221
 
4221
4222
def _multiply_two_scenarios(scenarios_left, scenarios_right):
4227
4228
    """
4228
4229
    return [
4229
4230
        ('%s,%s' % (left_name, right_name),
4230
 
         dict(left_dict.items() + right_dict.items()))
 
4231
         dict(left_dict, **right_dict))
4231
4232
        for left_name, left_dict in scenarios_left
4232
4233
        for right_name, right_dict in scenarios_right]
4233
4234