MCPcopy Create free account
hub / github.com/tox-dev/filelock / test_default_poll_interval

Function test_default_poll_interval

tests/core/test_timeout.py:115–129  ·  view source on GitHub ↗
(lock_type: type[BaseFileLock], tmp_path: Path)

Source from the content-addressed store, hash-verified

113
114@pytest.mark.parametrize("lock_type", [FileLock, SoftFileLock])
115def 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

Callers

nothing calls this directly

Calls 1

lock_typeFunction · 0.85

Tested by

no test coverage detected