Skip to content

Commit e5d3fb2

Browse files
strategy/common: add broken attribute to Strategy
This is the first step to broken state tracking for strategies. A future commit will add a decorator to be used on the the strategy's transition()/force() method that actually sets the exception and raises it for subsequent calls Signed-off-by: Bastian Krause <[email protected]>
1 parent 728dd38 commit e5d3fb2

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

labgrid/strategy/common.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,12 @@ class Strategy(Driver): # reuse driver handling
2424
TODO: This might also be just a driver?
2525
"""
2626

27+
# contains exception that broke the strategy or None
28+
broken = attr.ib(
29+
validator=attr.validators.optional(attr.validators.instance_of(Exception)),
30+
default=None
31+
)
32+
2733
def __attrs_post_init__(self):
2834
super().__attrs_post_init__()
2935
if self.target is None:

0 commit comments

Comments
 (0)