简体   繁体   中英

It is possible to skip/fail test in setup using pytest?

I am using pytest and hope to check:

Is it possible to conditionally skip/fail tests (grouped in class) in setup?

You can call pytest.skip(...) and pytest.fail(...) there. See " Imperative xfail from within a test or setup function " in the docs.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM