Pytest skipif: Skip a Test When a Condition is Not Met

Pytest skipif: Skip a Test When a Condition is Not Met

If you want to skip a test when a condition is not met, use pytest skipif. For example, in the code above, I use skipif to skip a test if the python version is less than 3.9.

My previous tips on testing in Python.

Scroll to Top

Work with Khuyen Tran

Work with Khuyen Tran