out, err = p.communicate()
if check and p.returncode != 0:
raise Exception('subprocess %r failed with status %d, stderr: %r'
- % (' '.join(argv), p.returncode, err))
+ % (' '.join(map(quote, cmd)), p.returncode, err))
return out, err, p
def bup(*args):
utcs = list(dropwhile(lambda x: x >= period_start['all'], utcs))
matches = takewhile(lambda x: x >= period_start['dailies'], utcs)
- dailies = [min(day_utcs) for yday, day_utcs
+ dailies = [max(day_utcs) for yday, day_utcs
in groupby(matches, lambda x: localtime(x).tm_yday)]
utcs = list(dropwhile(lambda x: x >= period_start['dailies'], utcs))
matches = takewhile(lambda x: x >= period_start['monthlies'], utcs)
- monthlies = [min(month_utcs) for month, month_utcs
+ monthlies = [max(month_utcs) for month, month_utcs
in groupby(matches, lambda x: localtime(x).tm_mon)]
utcs = dropwhile(lambda x: x >= period_start['monthlies'], utcs)
matches = takewhile(lambda x: x >= period_start['yearlies'], utcs)
- yearlies = [min(year_utcs) for year, year_utcs
+ yearlies = [max(year_utcs) for year, year_utcs
in groupby(matches, lambda x: localtime(x).tm_year)]
return chain(all, dailies, monthlies, yearlies)
wvpass(expected == actual)
+environ['GIT_AUTHOR_NAME'] = 'bup test'
+environ['GIT_COMMITTER_NAME'] = 'bup test'
+environ['GIT_AUTHOR_EMAIL'] = 'bup@a425bc70a02811e49bdf73ee56450e6f'
+environ['GIT_COMMITTER_EMAIL'] = 'bup@a425bc70a02811e49bdf73ee56450e6f'
+
seed = int(environ.get('BUP_TEST_SEED', time()))
random.seed(seed)
print('random seed:', seed, file=stderr)