| 66 | # This class is used to track that each timeout value is multiplied by |
| 67 | # `timeout_multiplier` exactly once. |
| 68 | class TimeoutParam(namedtuple("Timeout", ["start", "unmultiplied_duration", "description"])): |
| 69 | def __new__(cls, duration, description): |
| 70 | return super().__new__(cls, time(), duration, description) |
| 71 | |
| 72 | def remaining_duration(self, test_env): |
| 73 | duration = test_env.runner.timeout_multiplier * self.unmultiplied_duration |
| 74 | return max((self.start + duration) - time(), 0) |
| 75 | |
| 76 | |
| 77 | def relpath(path, start=os.curdir): |
no outgoing calls