From 45fbc079b9de69dc5e50e2cc182765ef6b9b2145 Mon Sep 17 00:00:00 2001 From: Ben Elliston Date: Sat, 22 Jun 2024 18:14:22 +1000 Subject: [PATCH] * tests/test_scenarios.py (test_all_scenarios): Only create the context object once as an optimisation. --- tests/test_scenarios.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tests/test_scenarios.py b/tests/test_scenarios.py index f403d41d..5934d305 100644 --- a/tests/test_scenarios.py +++ b/tests/test_scenarios.py @@ -17,8 +17,9 @@ class TestScenarios(unittest.TestCase): def test_all_scenarios(self): """Run each scenario and then check the generator list.""" + ctx = context.Context() for setupfn in scenarios.supply_scenarios.values(): - ctx = context.Context() + ctx.generators = [] setupfn(ctx) self.assertGreater(len(ctx.generators), 0) # sanity check