File tree Expand file tree Collapse file tree 2 files changed +6
-2
lines changed
src/frequenz/client/microgrid Expand file tree Collapse file tree 2 files changed +6
-2
lines changed Original file line number Diff line number Diff line change @@ -33,7 +33,9 @@ class Lifetime:
3333 def __post_init__ (self ) -> None :
3434 """Validate this lifetime."""
3535 if self .start is not None and self .end is not None and self .start > self .end :
36- raise ValueError ("Start must be before or equal to end." )
36+ raise ValueError (
37+ f"Start ({ self .start } ) must be before or equal to end ({ self .end } )"
38+ )
3739
3840 def is_operational_at (self , timestamp : datetime ) -> bool :
3941 """Check whether this lifetime is active at a specific timestamp."""
Original file line number Diff line number Diff line change @@ -200,7 +200,9 @@ def test_validation(
200200 )
201201
202202 if should_fail :
203- with pytest .raises (ValueError , match = "Start must be before or equal to end." ):
203+ with pytest .raises (
204+ ValueError , match = r"Start \(.*\) must be before or equal to end \(.*\)"
205+ ):
204206 Lifetime (start = start_time , end = end_time )
205207 else :
206208 lifetime = Lifetime (start = start_time , end = end_time )
You can’t perform that action at this time.
0 commit comments