-
Notifications
You must be signed in to change notification settings - Fork 2.5k
Closed
Labels
Milestone
Description
By default exceptions raised by library keywords stop executing the current test (except for possible teardown) and move execution to the next test. We have, however, some special exceptions that change this logic:
- Continuable failures allow execution to continue. The test will be marked failed in the end anyway.
- Fatal errors stop the whole test execution.
- Skip marks the test skipped, not failed.
The way users can mark exceptions continuable or fatal is by adding special attribute ROBOT_CONTINUE_ON_FAILURE or ROBOT_EXIT_ON_FAILURE, respectively, and the plan is to support the same approach with skip as well. There have been two reasons for using special attributes instead of exposing custom exceptions via the robot.api module:
- Attributes work also with Java based exceptions when using Jython.
- We wanted it to be possible to write library code without needing to have a dependency to the
robotmodule.
Both of the above reasons are still valid, but it would nevertheless often be useful to be able to import custom exceptions directly without a need to create them. I propose the following:
- Create custom exceptions for continuable failures, fatal errors and skip.
- Expose them via the
robot.apimodule. - Internally keep using the special attributes for detecting these special exceptions. This means that all old code will continue to work.
Reactions are currently unavailable