-
Notifications
You must be signed in to change notification settings - Fork 2.5k
Description
When loading a library in Robot Framework that currently does not have any keywords, you get this warning:
Although mostly helpful, in certain situations I would like to suppress this warning.
I was looking for a simple way to allow extensions to my library. By simple, I mean from a user's perspective where the core is a piece of Python code. For some background; I expect students to do algorithm design and convert the algorithm to Python. We can then run the Robot test suite to check functionality and performance.
What I came up with is having a basic Python file that can be imported by Robot Framework and then pass this library as an argument to the host library. The host library resolves the dependency using get_library_instance()
.
*** Settings ***
Library myalgorithm.py
Library hostlibrary algorithm=myalgorithm
In the broader sense it would not just be algorithms. I expect some of the extensions to also have keywords of their own. For the simple variants it will really just be a piece of code and importing as a library will yield a warning that the library does not contain any keywords. I would like to be able to suppress that warning in this situation.
The benefit of this approach is that one can do the configuration of the extension directly from Robot Framework. No need to fiddle around with pythonpath
or other import structures. Just build on the back of Robot's library management.