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

Add .try_assert() for a panic-free version of .assert() #196

Open
gibfahn opened this issue Mar 7, 2024 · 1 comment
Open

Add .try_assert() for a panic-free version of .assert() #196

gibfahn opened this issue Mar 7, 2024 · 1 comment

Comments

@gibfahn
Copy link

gibfahn commented Mar 7, 2024

The test suite I'm working with uses file locks on destructors to ensure things run synchronously. Having tests panic breaks that (unless we catch panics). Easiest way is to use all the .try_*() methods like .try_success() and .try_stderr().

However as far as I can tell there isn't a Result-returning way to do .assert(), which can panic, so filing this issue to ask whether we could have that.

@epage
Copy link
Contributor

epage commented Mar 7, 2024

Isn't that just output.ok()?.assert()?

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

No branches or pull requests

2 participants