From 9581eeebe5927ef2fb5754bb6820d2368860cfc8 Mon Sep 17 00:00:00 2001 From: Jean-Paul Calderone Date: Fri, 20 Jan 2023 15:14:18 -0500 Subject: [PATCH] explain the repeated save_capabilities calls --- integration/test_vectors.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/integration/test_vectors.py b/integration/test_vectors.py index 4608b9287..c5b765c71 100644 --- a/integration/test_vectors.py +++ b/integration/test_vectors.py @@ -69,10 +69,13 @@ async def skiptest_generate(reactor, request, alice): ) iterresults = generate(reactor, request, alice, space) - # Update the output file with results as they become available. results = [] async for result in iterresults: + # Accumulate the new result results.append(result) + # Then rewrite the whole output file with the new accumulator value. + # This means that if we fail partway through, we will still have + # recorded partial results -- instead of losing them all. vectors.save_capabilities(results) async def generate(