(self, time_monotonic: MagicMock)
| 727 | |
| 728 | @patch("time.monotonic") |
| 729 | def test_timeout_elapsed(self, time_monotonic: MagicMock) -> None: |
| 730 | time_monotonic.return_value = TIMEOUT_EPOCH |
| 731 | timeout = Timeout(total=3) |
| 732 | with pytest.raises(TimeoutStateError): |
| 733 | timeout.get_connect_duration() |
| 734 | |
| 735 | timeout.start_connect() |
| 736 | with pytest.raises(TimeoutStateError): |
| 737 | timeout.start_connect() |
| 738 | |
| 739 | time_monotonic.return_value = TIMEOUT_EPOCH + 2 |
| 740 | assert timeout.get_connect_duration() == 2 |
| 741 | time_monotonic.return_value = TIMEOUT_EPOCH + 37 |
| 742 | assert timeout.get_connect_duration() == 37 |
| 743 | |
| 744 | def test_is_fp_closed_object_supports_closed(self) -> None: |
| 745 | class ClosedFile: |
nothing calls this directly
no test coverage detected