Skip done from Python library keyword shows error in log

I have these test cases in a test suite
*** Test Cases ***

Test Robot Skip
    Skip  Skip done from .robot

Test Python Skip
    My Own Skip  Skip done from .py

And this keyword defined in a keyword library
class KwLibrary:

    def my_own_skip(self, msg: str):

This results in a log file like:

Why does the skip from keyword library show error in log but not the one called directly in test suite? How could I skip test case in the library keyword without showing error in log?

@Vahv1 Do you have the following import in your custom Python library?

from robot.libraries.BuiltIn import BuiltIn

The following works for me:

from robot.api.deco import keyword
from robot.libraries.BuiltIn import BuiltIn

class CustomLibrary:

    def my_own_skip(self, msg: str):

Yes, I have those exact same imports. Just to make sure, so you don’t get an error in the test run log when using that? The skip works for me too and the test case doesn’t fail. But I’d like to get rid of the unnecessary error in the log.

@Vahv1 I don’t get an error:

I see, should’ve thought of that. Found out that the culprit was our custom implementation of run_keyword-method. Thanks for the help!

1 Like