(mocker: MockerFixture)
| 131 | |
| 132 | @pytest.fixture |
| 133 | def steady_clock(mocker: MockerFixture) -> MockType: |
| 134 | # Advancing 10 ms per read keeps the first poll inside the timeout even on a loaded runner. |
| 135 | sleep_mock = mocker.create_autospec(time.sleep) |
| 136 | clock = SimpleNamespace( |
| 137 | perf_counter=mocker.create_autospec(time.perf_counter, side_effect=(reading / 100 for reading in count())), |
| 138 | sleep=sleep_mock, |
| 139 | ) |
| 140 | mocker.patch("filelock._core._state.time", new=clock) |
| 141 | mocker.patch("filelock._core._acquire.time", new=clock) |
| 142 | return sleep_mock |
| 143 | |
| 144 | |
| 145 | @pytest.mark.parametrize("lock_type", [FileLock, SoftFileLock]) |
nothing calls this directly
no outgoing calls
no test coverage detected