-
Notifications
You must be signed in to change notification settings - Fork 16
Open
Description
I would like to use RobotKernel to develop larger Notebooks with multiple Cells.
For this notebook there is one library, which needs to be "setup" and keeps a state.
In current Implementation of the robotkernel it looks like, the imported Library is getting a new instance with each state.
Would it be possible, to keep one instance of a library over multiple cells?
I have the following code:
%%python module LibraryWithState
class LibraryWithState:
def __init__(self):
self.state = 0
def get_increased_state(self):
self.state += 1
return self.state
And then the cells like
*** Settings ***
Library LibraryWithState
*** Test Cases ***
Check the test Library
Get Increased State
... which results in an output of the expected "1"
And the next cell like
*** Settings ***
Library LibraryWithState
*** Test Cases ***
Check the test Library
Get Increased State
this second output is still 1, but I wanted to see 2.
Is it possible, to achieve this? As I mentioned, seems with each cell, my python library gets freshly instantiated.
I would like to overcome this.
Thank you for any feedback or proposal.
Metadata
Metadata
Assignees
Labels
No labels