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

Runtime skipping of tests #162

Open
epage opened this issue Sep 1, 2022 · 4 comments
Open

Runtime skipping of tests #162

epage opened this issue Sep 1, 2022 · 4 comments

Comments

@epage
Copy link

epage commented Sep 1, 2022

Something I've found useful from pytest is the ability for a test (or a fixture) to be able to report that it is skipped. When a fixture is skipped, all dependencies are automatically skipped as well.

For example, in cargo's tests we have our own test macro that allows us to skip tests if you aren't running on nightly or if you don't have git. Due to how libtest works, these get reported as "passed" rather than "ignore" or "skipped".

Being able to support this natively and report it correctly to the user would be a big help!

@epage
Copy link
Author

epage commented Sep 1, 2022

I could see a case to be made that fixtures should only be the things to support runtime skipping as what is most likely missing is a fixture. Some of these fixtures might be more environment related ("am I running in nightly rust", "is git present") but I could see still creating simple fixtures for those cases to be useful for reporting to a user why a test was skipped.

@la10736
Copy link
Owner

la10736 commented Sep 1, 2022

Can you give me some example? I suspect that you can already use rust annotation to skip or ignore tests.

@epage
Copy link
Author

epage commented Sep 1, 2022

Cargo's has tests that only run on nightly or require git. We originally had guards at the start test functions and then moved it into our own wrapper around libtest, see rust-lang/cargo#9892

@la10736
Copy link
Owner

la10736 commented Sep 2, 2022

Ok, now I've understand the feature.

Seams nice and useful.... But now I've no too much time to work on it. I hope to find some time to implement it but I don't know when :(

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