(lock_type: type[BaseFileLock], tmp_path: Path)
| 113 | |
| 114 | @pytest.mark.parametrize("lock_type", [FileLock, SoftFileLock]) |
| 115 | def test_default_poll_interval(lock_type: type[BaseFileLock], tmp_path: Path) -> None: |
| 116 | lock_path = tmp_path / "a" |
| 117 | lock = lock_type(str(lock_path)) |
| 118 | assert lock.poll_interval == pytest.approx(0.05) |
| 119 | |
| 120 | lock_2 = lock_type(str(lock_path), poll_interval=0.1) |
| 121 | assert lock_2.poll_interval == pytest.approx(0.1) |
| 122 | |
| 123 | lock_2.poll_interval = 0.2 |
| 124 | assert lock_2.poll_interval == pytest.approx(0.2) |
| 125 | |
| 126 | lock_3 = lock_type(str(lock_path), poll_interval=0) |
| 127 | assert lock_3.poll_interval == 0 |
| 128 | lock_3.poll_interval = 0.0 |
| 129 | assert lock_3.poll_interval == pytest.approx(0.0) |
| 130 | |
| 131 | |
| 132 | @pytest.fixture |
nothing calls this directly
no test coverage detected