Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

<ctrl+c> support for teardown #44

Open
CosmicHorrorDev opened this issue Jun 11, 2023 · 2 comments
Open

<ctrl+c> support for teardown #44

CosmicHorrorDev opened this issue Jun 11, 2023 · 2 comments
Labels
A-pytest Area: pytest-like framework implemented on top of the new harness C-enhancement Category: Raise on the bar on expectations

Comments

@CosmicHorrorDev
Copy link

CosmicHorrorDev commented Jun 11, 2023

Hiya! In some projects it's common to startup external resources that are used by the test suite when running cargo test although normally they rely on drop() running to tear down the resources when finished. This causes issues when killing the test suite with something like <ctrl+c> since drop doesn't actually end up running

It would be nice if there was some way of setting up or registering a resource that could be torn down even when stopping the test suite with signals

(Side note: this whole project looks really promising. Let me know if there are any ways that I could help out)

@epage epage added A-pytest Area: pytest-like framework implemented on top of the new harness C-enhancement Category: Raise on the bar on expectations labels Jun 12, 2023
@epage
Copy link
Contributor

epage commented Jun 12, 2023

Thanks for reporting this!

The question is whether we should always ensure fixture teardown happens on ctrl-c or if fixtures should specially register for it.

(Side note: this whole project looks really promising. Let me know if there are any ways that I could help out)

I've merged my branches as-is. I've already offered for someone else to pick up #13 if they feel up to it. Interested in #8 ad #14?

@CosmicHorrorDev
Copy link
Author

The question is whether we should always ensure fixture teardown happens on ctrl-c or if fixtures should specially register for it.

Hmmmm, I can't think of a motivating usecase where I would want to avoid running teardown specifically when using ctrl+c, but I haven't given it too much thought

I've merged my branches as-is. I've already offered for someone else to pick up #13 if they feel up to it. Interested in #8 ad #14?

Sure! #8 and #14 look like they could be fun to work on :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-pytest Area: pytest-like framework implemented on top of the new harness C-enhancement Category: Raise on the bar on expectations
Projects
None yet
Development

No branches or pull requests

2 participants