Add ability to ignore tests at runtime. (original) (raw)
For medium–large scale projects, or projects that have a lot of integrations with third party services. It would nice to be able to ignore tests based on the environment the tests are being run in. One example would be to run tests if an environment variable is present.
You can workaround this with something like the following, however the output of the test is ok
and not ignored
, misleading the user that the test was successful.
#[test] fn foo() { if env::var("FOO").is_none() { return; } let foo = env::var("FOO").unwrap(); }