locking tests in pytest