Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def test_lock(self):
with FileLock("lockfile") as f:
assert f.is_locked
assert not f.is_locked