Skip to content

Avoid destroying/unloading the resources before entering the debugger#503

Merged
glehmann merged 2 commits into
masterfrom
gln/tests-add-defer-fixture-yrnw
Apr 28, 2026
Merged

Avoid destroying/unloading the resources before entering the debugger#503
glehmann merged 2 commits into
masterfrom
gln/tests-add-defer-fixture-yrnw

Conversation

@glehmann
Copy link
Copy Markdown
Member

@glehmann glehmann commented Apr 27, 2026

Same as #436, but for tests not in storage/

to ease the resource management in some complex tests.
See the defer docstring in conftest.py for more details.

Signed-off-by: Gaëtan Lehmann <gaetan.lehmann@vates.tech>
@glehmann glehmann requested review from a team as code owners April 27, 2026 12:10
Copy link
Copy Markdown
Contributor

@semarie semarie left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM
it will be a good improvement for readability and debugging, thanks.

Copy link
Copy Markdown
Contributor

@psafont psafont left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice change, it reduces indentation while managing resources, similar to OCaml's pattern of using let@ resource = with_resource params in ...

Copy link
Copy Markdown
Member

@dinhngtu dinhngtu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wonder if there are fixtures that can be trivially replaced by defer, and will that net us any benefit in terms of code cleanliness?

Comment thread tests/xen/test_ring0.py Outdated
Comment thread tests/network/test_vif_management.py Outdated
Signed-off-by: Gaëtan Lehmann <gaetan.lehmann@vates.tech>
@glehmann glehmann force-pushed the gln/tests-add-defer-fixture-yrnw branch from ee0f37d to 09c4d6e Compare April 28, 2026 11:21
@glehmann glehmann requested a review from dinhngtu April 28, 2026 11:21
@glehmann glehmann merged commit bf495c2 into master Apr 28, 2026
9 checks passed
@glehmann glehmann deleted the gln/tests-add-defer-fixture-yrnw branch April 28, 2026 19:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants