File tree Expand file tree Collapse file tree 1 file changed +7
-3
lines changed
tests/timeseries/_resampling/wall_clock_timer Expand file tree Collapse file tree 1 file changed +7
-3
lines changed Original file line number Diff line number Diff line change @@ -131,19 +131,23 @@ def __eq__(self, actual: object) -> bool:
131131 return abs (diff ) <= self .abs
132132
133133
134+ # We need to rewrite most of the attributes in these classes to use approximate
135+ # comparisons. This means if a new field is added, we need to update the
136+ # approx_tick_info function below to handle the new fields. To catch this, we do
137+ # a sanity check here, so if new fields are added we get an early warning instead of
138+ # getting tests errors because of some rounding error in a newly added field.
134139assert set (ClocksInfo .__dataclass_fields__ .keys ()) == {
135140 "monotonic_requested_sleep" ,
136141 "monotonic_time" ,
137142 "wall_clock_time" ,
138143 "monotonic_elapsed" ,
139144 "wall_clock_elapsed" ,
140145 "wall_clock_factor" ,
141- }, "ClocksInfo fields have changed, please update the approx_tick_info function."
142-
146+ }, "ClocksInfo fields were added or removed, please update the approx_tick_info function."
143147assert set (TickInfo .__dataclass_fields__ .keys ()) == {
144148 "expected_tick_time" ,
145149 "sleep_infos" ,
146- }
150+ }, "TickInfo fields were added or removed, please update the approx_tick_info function."
147151
148152
149153def approx_tick_info (
You can’t perform that action at this time.
0 commit comments