If you expect a test to fail, use pytest xfail
marker. This will prevent pytest from marking a test as failed when there is an exception.
To be more specific about what exception you expect to see, use the raises
argument.
If you expect a test to fail, use pytest xfail
marker. This will prevent pytest from marking a test as failed when there is an exception.
To be more specific about what exception you expect to see, use the raises
argument.
CodeCut is a platform that offers short and visually appealing code snippets related to data science, data analysis, data engineering, and Python programming.
Copyright © 2025 Code Cut - All rights reserved.