Skip to content

Commit

Permalink
refactor work list into function
Browse files Browse the repository at this point in the history
  • Loading branch information
charles-cooper committed Mar 16, 2024
1 parent 968d653 commit 588ced1
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions boa/test/plugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ def pytest_fixture_setup(fixturedef, request):
ctx.__enter__()


# TODO: maybe use FixtureDef.addfinalizer()?
def pytest_fixture_post_finalizer(fixturedef, request):
fid = id(fixturedef)

Expand All @@ -75,6 +76,10 @@ def pytest_fixture_post_finalizer(fixturedef, request):
# that should have come before them get run.
_task_list.add(fid)

_work_task_list()


def _work_task_list():
while (fid := next(reversed(_fixture_map.keys()), None)) in _task_list:
ctx = _fixture_map.pop(fid)
_task_list.remove(fid)
Expand Down

0 comments on commit 588ced1

Please sign in to comment.