(cls, timeline, start, stop)
| 387 | |
| 388 | class Interval(tuple): |
| 389 | def __new__(cls, timeline, start, stop): |
| 390 | assert start is None or isinstance(start, Expectation) |
| 391 | assert stop is None or isinstance(stop, Expectation) |
| 392 | if not isinstance(stop, Occurrence): |
| 393 | timeline.expect_frozen() |
| 394 | |
| 395 | occs = () |
| 396 | if start is None: |
| 397 | start = timeline._beginning |
| 398 | |
| 399 | for occ in start.and_following(up_to=stop): |
| 400 | if occ == stop: |
| 401 | break |
| 402 | if occ == start: |
| 403 | occs = occ.and_following(up_to=stop) |
| 404 | break |
| 405 | |
| 406 | result = super().__new__(cls, occs) |
| 407 | result.timeline = timeline |
| 408 | result.start = start |
| 409 | result.stop = stop |
| 410 | return result |
| 411 | |
| 412 | def __contains__(self, expectation): |
| 413 | return any(expectation.test(self[0], self[-1])) if len(self) > 0 else False |
nothing calls this directly
no test coverage detected