Skip to content

Commit

Permalink
* tests/test_scenarios.py (test_all_scenarios): Only create the
Browse files Browse the repository at this point in the history
  context object once as an optimisation.
  • Loading branch information
bje- committed Jun 22, 2024
1 parent 533a10c commit 45fbc07
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion tests/test_scenarios.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 45fbc07

Please sign in to comment.