提交 3bccda5a authored 作者: Olivier Delalleau's avatar Olivier Delalleau

Fixed the displayed number of failed tests in script run_tests_in_batch

上级 5169452d
...@@ -60,7 +60,7 @@ def main(): ...@@ -60,7 +60,7 @@ def main():
assert n_tests == max(ids) assert n_tests == max(ids)
# Run tests. # Run tests.
n_batch = 100 n_batch = 100
failed = [] failed = set()
print """\ print """\
################################### ###################################
# RUNNING TESTS IN BATCHES OF %s # # RUNNING TESTS IN BATCHES OF %s #
...@@ -75,13 +75,13 @@ def main(): ...@@ -75,13 +75,13 @@ def main():
stderr=dummy_out.fileno()) stderr=dummy_out.fileno())
# Recover failed test indices from the 'failed' field of the '.noseids' # Recover failed test indices from the 'failed' field of the '.noseids'
# file. We need to do it after each batch because otherwise this field # file. We need to do it after each batch because otherwise this field
# gets erased. # may get erased. We use a set because it seems like it is not
failed += cPickle.load(open(noseids_file, 'rb'))['failed'] # systematically erased though, and we want to avoid duplicates.
failed = failed.union(cPickle.load(open(noseids_file, 'rb'))['failed'])
print '%s%% done (failed: %s)' % ((test_range[-1] * 100) // n_tests, print '%s%% done (failed: %s)' % ((test_range[-1] * 100) // n_tests,
len(failed)) len(failed))
# Remove duplicated failed tests (may happen because it seems the 'failed' # Sort for cosmetic purpose only.
# field is not *systematically* overwritten after each call to nosetests). failed = sorted(failed)
failed = sorted(set(failed))
if failed: if failed:
# Re-run only failed tests # Re-run only failed tests
print """\ print """\
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论