MarketSquare / robotframework-sherlock

Robot Framework code inspector
Apache License 2.0
14 stars 1 forks source link

issue with BuiltIn().get_library_instance in python library __init__ #72

Closed tkopra closed 1 year ago

tkopra commented 2 years ago

Hi!

Sherlock is having trouble with below like code in project's python library: `class My_Lib: """Library documentation"""

def __init__(self,):
    """Get QWeb library instance"""
    self.QWeb = BuiltIn().get_library_instance('QWeb')`

When running sherlock, it just raises fatal exception RobotNotRunningError('Cannot access execution context') and not giving any results.

Tero

bhirsz commented 1 year ago

It should be handled by #89 . Such libraries cannot be initialized by Sherlock (since the conditions are only possible during real execution) and now it should not fail Sherlock but issue a warning. I will additionally implement a way to produce library keywords documentation manually (using libdoc) so it's possible to pre-generate library metadata for Sherlock if it's not possible automatically.