I'm automating some software tests at the moment and I was wondering if it's possible to pass or fail a test in python so that RF shows the same result. For example, I'm doing an install test and at the end I check through the registry to confirm a clean install. If anything is missing I want to be able to essentially exit(0) and have RF show a fail, but just returns "[ ERROR ] Execution stopped by user."
Tests fail when a keyword fails. Keywords fail when they throw an exception (or call a keyword that throws an exception). So, you can write a keyword that executes your script and throws an exception if the return code is non-zero.
In other words, what you want won't happen automatically, but is extremely easy to implement.
Returning a pass/fail to robot framework from python code