tox-dev / filelock

A platform-independent file lock for Python.

Home Page:https://py-filelock.readthedocs.io

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

[regression] 12 tests fail with version 3.12.3, 0 tests were failing with version 3.12.2

yurivict opened this issue · comments

========================================================================================== FAILURES ===========================================================================================
_______________________________________________________________________ test_simple[new2/new3/c-PurePath-SoftFileLock] ________________________________________________________________________

lock_type = <class 'filelock._soft.SoftFileLock'>, path_type = <class 'pathlib.PurePath'>, filename = 'new2/new3/c'
tmp_path = PosixPath('/tmp/pytest-of-yuri/pytest-3/test_simple_new2_new3_c_PurePa0'), caplog = <_pytest.logging.LogCaptureFixture object at 0x8d6fffee0>

    @pytest.mark.parametrize("lock_type", [FileLock, SoftFileLock])
    @pytest.mark.parametrize("path_type", [str, PurePath, Path])
    @pytest.mark.parametrize("filename", ["a", "new/b", "new2/new3/c"])
    def test_simple(
        lock_type: type[BaseFileLock],
        path_type: type[str | Path],
        filename: str,
        tmp_path: Path,
        caplog: pytest.LogCaptureFixture,
    ) -> None:
        caplog.set_level(logging.DEBUG)
    
        # test lock creation by passing a `str`
        lock_path = tmp_path / filename
        lock = lock_type(path_type(lock_path))
>       with lock as locked:

tests/test_filelock.py:41: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
/usr/local/lib/python3.9/site-packages/filelock/_api.py:255: in __enter__
    self.acquire()
/usr/local/lib/python3.9/site-packages/filelock/_api.py:213: in acquire
    self._acquire()
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

self = <filelock._soft.SoftFileLock object at 0x8d6fffd90>

    def _acquire(self) -> None:
        raise_on_not_writable_file(self.lock_file)
        # first check for exists and read-only mode as the open will mask this case as EEXIST
        flags = (
            os.O_WRONLY  # open for writing only
            | os.O_CREAT
            | os.O_EXCL  # together with above raise EEXIST if the file specified by filename exists
            | os.O_TRUNC  # truncate the file to zero byte
        )
        try:
>           file_handler = os.open(self.lock_file, flags, self._context.mode)
E           FileNotFoundError: [Errno 2] No such file or directory: '/tmp/pytest-of-yuri/pytest-3/test_simple_new2_new3_c_PurePa0/new2/new3/c'

/usr/local/lib/python3.9/site-packages/filelock/_soft.py:26: FileNotFoundError
-------------------------------------------------------------------------------------- Captured log call --------------------------------------------------------------------------------------
DEBUG    filelock:_api.py:212 Attempting to acquire lock 37966839184 on /tmp/pytest-of-yuri/pytest-3/test_simple_new2_new3_c_PurePa0/new2/new3/c
____________________________________________________________________________ test_simple[new/b-Path-SoftFileLock] _____________________________________________________________________________

lock_type = <class 'filelock._soft.SoftFileLock'>, path_type = <class 'pathlib.Path'>, filename = 'new/b', tmp_path = PosixPath('/tmp/pytest-of-yuri/pytest-3/test_simple_new_b_Path_SoftFil0')
caplog = <_pytest.logging.LogCaptureFixture object at 0x8d51e4460>

    @pytest.mark.parametrize("lock_type", [FileLock, SoftFileLock])
    @pytest.mark.parametrize("path_type", [str, PurePath, Path])
    @pytest.mark.parametrize("filename", ["a", "new/b", "new2/new3/c"])
    def test_simple(
        lock_type: type[BaseFileLock],
        path_type: type[str | Path],
        filename: str,
        tmp_path: Path,
        caplog: pytest.LogCaptureFixture,
    ) -> None:
        caplog.set_level(logging.DEBUG)
    
        # test lock creation by passing a `str`
        lock_path = tmp_path / filename
        lock = lock_type(path_type(lock_path))
>       with lock as locked:

tests/test_filelock.py:41: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
/usr/local/lib/python3.9/site-packages/filelock/_api.py:255: in __enter__
    self.acquire()
/usr/local/lib/python3.9/site-packages/filelock/_api.py:213: in acquire
    self._acquire()
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

self = <filelock._soft.SoftFileLock object at 0x8d51e4670>

    def _acquire(self) -> None:
        raise_on_not_writable_file(self.lock_file)
        # first check for exists and read-only mode as the open will mask this case as EEXIST
        flags = (
            os.O_WRONLY  # open for writing only
            | os.O_CREAT
            | os.O_EXCL  # together with above raise EEXIST if the file specified by filename exists
            | os.O_TRUNC  # truncate the file to zero byte
        )
        try:
>           file_handler = os.open(self.lock_file, flags, self._context.mode)
E           FileNotFoundError: [Errno 2] No such file or directory: '/tmp/pytest-of-yuri/pytest-3/test_simple_new_b_Path_SoftFil0/new/b'

/usr/local/lib/python3.9/site-packages/filelock/_soft.py:26: FileNotFoundError
-------------------------------------------------------------------------------------- Captured log call --------------------------------------------------------------------------------------
DEBUG    filelock:_api.py:212 Attempting to acquire lock 37935269488 on /tmp/pytest-of-yuri/pytest-3/test_simple_new_b_Path_SoftFil0/new/b
_________________________________________________________________________ test_simple[new2/new3/c-Path-SoftFileLock] __________________________________________________________________________

lock_type = <class 'filelock._soft.SoftFileLock'>, path_type = <class 'pathlib.Path'>, filename = 'new2/new3/c'
tmp_path = PosixPath('/tmp/pytest-of-yuri/pytest-3/test_simple_new2_new3_c_Path_S0'), caplog = <_pytest.logging.LogCaptureFixture object at 0x8dbf83190>

    @pytest.mark.parametrize("lock_type", [FileLock, SoftFileLock])
    @pytest.mark.parametrize("path_type", [str, PurePath, Path])
    @pytest.mark.parametrize("filename", ["a", "new/b", "new2/new3/c"])
    def test_simple(
        lock_type: type[BaseFileLock],
        path_type: type[str | Path],
        filename: str,
        tmp_path: Path,
        caplog: pytest.LogCaptureFixture,
    ) -> None:
        caplog.set_level(logging.DEBUG)
    
        # test lock creation by passing a `str`
        lock_path = tmp_path / filename
        lock = lock_type(path_type(lock_path))
>       with lock as locked:

tests/test_filelock.py:41: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
/usr/local/lib/python3.9/site-packages/filelock/_api.py:255: in __enter__
    self.acquire()
/usr/local/lib/python3.9/site-packages/filelock/_api.py:213: in acquire
    self._acquire()
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

self = <filelock._soft.SoftFileLock object at 0x8dbf83f70>

    def _acquire(self) -> None:
        raise_on_not_writable_file(self.lock_file)
        # first check for exists and read-only mode as the open will mask this case as EEXIST
        flags = (
            os.O_WRONLY  # open for writing only
            | os.O_CREAT
            | os.O_EXCL  # together with above raise EEXIST if the file specified by filename exists
            | os.O_TRUNC  # truncate the file to zero byte
        )
        try:
>           file_handler = os.open(self.lock_file, flags, self._context.mode)
E           FileNotFoundError: [Errno 2] No such file or directory: '/tmp/pytest-of-yuri/pytest-3/test_simple_new2_new3_c_Path_S0/new2/new3/c'

/usr/local/lib/python3.9/site-packages/filelock/_soft.py:26: FileNotFoundError
-------------------------------------------------------------------------------------- Captured log call --------------------------------------------------------------------------------------
DEBUG    filelock:_api.py:212 Attempting to acquire lock 38050217840 on /tmp/pytest-of-yuri/pytest-3/test_simple_new2_new3_c_Path_S0/new2/new3/c
__________________________________________________________________________ test_simple[new/b-PurePath-SoftFileLock] ___________________________________________________________________________

lock_type = <class 'filelock._soft.SoftFileLock'>, path_type = <class 'pathlib.PurePath'>, filename = 'new/b'
tmp_path = PosixPath('/tmp/pytest-of-yuri/pytest-3/test_simple_new_b_PurePath_Sof0'), caplog = <_pytest.logging.LogCaptureFixture object at 0x8d3c68820>

    @pytest.mark.parametrize("lock_type", [FileLock, SoftFileLock])
    @pytest.mark.parametrize("path_type", [str, PurePath, Path])
    @pytest.mark.parametrize("filename", ["a", "new/b", "new2/new3/c"])
    def test_simple(
        lock_type: type[BaseFileLock],
        path_type: type[str | Path],
        filename: str,
        tmp_path: Path,
        caplog: pytest.LogCaptureFixture,
    ) -> None:
        caplog.set_level(logging.DEBUG)
    
        # test lock creation by passing a `str`
        lock_path = tmp_path / filename
        lock = lock_type(path_type(lock_path))
>       with lock as locked:

tests/test_filelock.py:41: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
/usr/local/lib/python3.9/site-packages/filelock/_api.py:255: in __enter__
    self.acquire()
/usr/local/lib/python3.9/site-packages/filelock/_api.py:213: in acquire
    self._acquire()
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

self = <filelock._soft.SoftFileLock object at 0x8dc4d09a0>

    def _acquire(self) -> None:
        raise_on_not_writable_file(self.lock_file)
        # first check for exists and read-only mode as the open will mask this case as EEXIST
        flags = (
            os.O_WRONLY  # open for writing only
            | os.O_CREAT
            | os.O_EXCL  # together with above raise EEXIST if the file specified by filename exists
            | os.O_TRUNC  # truncate the file to zero byte
        )
        try:
>           file_handler = os.open(self.lock_file, flags, self._context.mode)
E           FileNotFoundError: [Errno 2] No such file or directory: '/tmp/pytest-of-yuri/pytest-3/test_simple_new_b_PurePath_Sof0/new/b'

/usr/local/lib/python3.9/site-packages/filelock/_soft.py:26: FileNotFoundError
-------------------------------------------------------------------------------------- Captured log call --------------------------------------------------------------------------------------
DEBUG    filelock:_api.py:212 Attempting to acquire lock 38055774624 on /tmp/pytest-of-yuri/pytest-3/test_simple_new_b_PurePath_Sof0/new/b
__________________________________________________________________________ test_simple[new2/new3/c-str-UnixFileLock] __________________________________________________________________________

lock_type = <class 'filelock._unix.UnixFileLock'>, path_type = <class 'str'>, filename = 'new2/new3/c', tmp_path = PosixPath('/tmp/pytest-of-yuri/pytest-3/test_simple_new2_new3_c_str_Un0')
caplog = <_pytest.logging.LogCaptureFixture object at 0x8dc4aca30>

    @pytest.mark.parametrize("lock_type", [FileLock, SoftFileLock])
    @pytest.mark.parametrize("path_type", [str, PurePath, Path])
    @pytest.mark.parametrize("filename", ["a", "new/b", "new2/new3/c"])
    def test_simple(
        lock_type: type[BaseFileLock],
        path_type: type[str | Path],
        filename: str,
        tmp_path: Path,
        caplog: pytest.LogCaptureFixture,
    ) -> None:
        caplog.set_level(logging.DEBUG)
    
        # test lock creation by passing a `str`
        lock_path = tmp_path / filename
        lock = lock_type(path_type(lock_path))
>       with lock as locked:

tests/test_filelock.py:41: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
/usr/local/lib/python3.9/site-packages/filelock/_api.py:255: in __enter__
    self.acquire()
/usr/local/lib/python3.9/site-packages/filelock/_api.py:213: in acquire
    self._acquire()
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

self = <filelock._unix.UnixFileLock object at 0x8dc4acd00>

    def _acquire(self) -> None:
        open_flags = os.O_RDWR | os.O_CREAT | os.O_TRUNC
>       fd = os.open(self.lock_file, open_flags, self._context.mode)
E       FileNotFoundError: [Errno 2] No such file or directory: '/tmp/pytest-of-yuri/pytest-3/test_simple_new2_new3_c_str_Un0/new2/new3/c'

/usr/local/lib/python3.9/site-packages/filelock/_unix.py:37: FileNotFoundError
-------------------------------------------------------------------------------------- Captured log call --------------------------------------------------------------------------------------
DEBUG    filelock:_api.py:212 Attempting to acquire lock 38055628032 on /tmp/pytest-of-yuri/pytest-3/test_simple_new2_new3_c_str_Un0/new2/new3/c
__________________________________________________________________________ test_simple[new/b-PurePath-UnixFileLock] ___________________________________________________________________________

lock_type = <class 'filelock._unix.UnixFileLock'>, path_type = <class 'pathlib.PurePath'>, filename = 'new/b'
tmp_path = PosixPath('/tmp/pytest-of-yuri/pytest-3/test_simple_new_b_PurePath_Uni0'), caplog = <_pytest.logging.LogCaptureFixture object at 0x905e9a280>

    @pytest.mark.parametrize("lock_type", [FileLock, SoftFileLock])
    @pytest.mark.parametrize("path_type", [str, PurePath, Path])
    @pytest.mark.parametrize("filename", ["a", "new/b", "new2/new3/c"])
    def test_simple(
        lock_type: type[BaseFileLock],
        path_type: type[str | Path],
        filename: str,
        tmp_path: Path,
        caplog: pytest.LogCaptureFixture,
    ) -> None:
        caplog.set_level(logging.DEBUG)
    
        # test lock creation by passing a `str`
        lock_path = tmp_path / filename
        lock = lock_type(path_type(lock_path))
>       with lock as locked:

tests/test_filelock.py:41: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
/usr/local/lib/python3.9/site-packages/filelock/_api.py:255: in __enter__
    self.acquire()
/usr/local/lib/python3.9/site-packages/filelock/_api.py:213: in acquire
    self._acquire()
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

self = <filelock._unix.UnixFileLock object at 0x905e9a850>

    def _acquire(self) -> None:
        open_flags = os.O_RDWR | os.O_CREAT | os.O_TRUNC
>       fd = os.open(self.lock_file, open_flags, self._context.mode)
E       FileNotFoundError: [Errno 2] No such file or directory: '/tmp/pytest-of-yuri/pytest-3/test_simple_new_b_PurePath_Uni0/new/b'

/usr/local/lib/python3.9/site-packages/filelock/_unix.py:37: FileNotFoundError
-------------------------------------------------------------------------------------- Captured log call --------------------------------------------------------------------------------------
DEBUG    filelock:_api.py:212 Attempting to acquire lock 38753904720 on /tmp/pytest-of-yuri/pytest-3/test_simple_new_b_PurePath_Uni0/new/b
_______________________________________________________________________ test_simple[new2/new3/c-PurePath-UnixFileLock] ________________________________________________________________________

lock_type = <class 'filelock._unix.UnixFileLock'>, path_type = <class 'pathlib.PurePath'>, filename = 'new2/new3/c'
tmp_path = PosixPath('/tmp/pytest-of-yuri/pytest-3/test_simple_new2_new3_c_PurePa1'), caplog = <_pytest.logging.LogCaptureFixture object at 0x8dc4bb5b0>

    @pytest.mark.parametrize("lock_type", [FileLock, SoftFileLock])
    @pytest.mark.parametrize("path_type", [str, PurePath, Path])
    @pytest.mark.parametrize("filename", ["a", "new/b", "new2/new3/c"])
    def test_simple(
        lock_type: type[BaseFileLock],
        path_type: type[str | Path],
        filename: str,
        tmp_path: Path,
        caplog: pytest.LogCaptureFixture,
    ) -> None:
        caplog.set_level(logging.DEBUG)
    
        # test lock creation by passing a `str`
        lock_path = tmp_path / filename
        lock = lock_type(path_type(lock_path))
>       with lock as locked:

tests/test_filelock.py:41: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
/usr/local/lib/python3.9/site-packages/filelock/_api.py:255: in __enter__
    self.acquire()
/usr/local/lib/python3.9/site-packages/filelock/_api.py:213: in acquire
    self._acquire()
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

self = <filelock._unix.UnixFileLock object at 0x8dc4bb8b0>

    def _acquire(self) -> None:
        open_flags = os.O_RDWR | os.O_CREAT | os.O_TRUNC
>       fd = os.open(self.lock_file, open_flags, self._context.mode)
E       FileNotFoundError: [Errno 2] No such file or directory: '/tmp/pytest-of-yuri/pytest-3/test_simple_new2_new3_c_PurePa1/new2/new3/c'

/usr/local/lib/python3.9/site-packages/filelock/_unix.py:37: FileNotFoundError
-------------------------------------------------------------------------------------- Captured log call --------------------------------------------------------------------------------------
DEBUG    filelock:_api.py:212 Attempting to acquire lock 38055688368 on /tmp/pytest-of-yuri/pytest-3/test_simple_new2_new3_c_PurePa1/new2/new3/c
_____________________________________________________________________________ test_simple[new/b-str-UnixFileLock] _____________________________________________________________________________

lock_type = <class 'filelock._unix.UnixFileLock'>, path_type = <class 'str'>, filename = 'new/b', tmp_path = PosixPath('/tmp/pytest-of-yuri/pytest-3/test_simple_new_b_str_UnixFile0')
caplog = <_pytest.logging.LogCaptureFixture object at 0x90ae63070>

    @pytest.mark.parametrize("lock_type", [FileLock, SoftFileLock])
    @pytest.mark.parametrize("path_type", [str, PurePath, Path])
    @pytest.mark.parametrize("filename", ["a", "new/b", "new2/new3/c"])
    def test_simple(
        lock_type: type[BaseFileLock],
        path_type: type[str | Path],
        filename: str,
        tmp_path: Path,
        caplog: pytest.LogCaptureFixture,
    ) -> None:
        caplog.set_level(logging.DEBUG)
    
        # test lock creation by passing a `str`
        lock_path = tmp_path / filename
        lock = lock_type(path_type(lock_path))
>       with lock as locked:

tests/test_filelock.py:41: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
/usr/local/lib/python3.9/site-packages/filelock/_api.py:255: in __enter__
    self.acquire()
/usr/local/lib/python3.9/site-packages/filelock/_api.py:213: in acquire
    self._acquire()
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

self = <filelock._unix.UnixFileLock object at 0x90ae63a30>

    def _acquire(self) -> None:
        open_flags = os.O_RDWR | os.O_CREAT | os.O_TRUNC
>       fd = os.open(self.lock_file, open_flags, self._context.mode)
E       FileNotFoundError: [Errno 2] No such file or directory: '/tmp/pytest-of-yuri/pytest-3/test_simple_new_b_str_UnixFile0/new/b'

/usr/local/lib/python3.9/site-packages/filelock/_unix.py:37: FileNotFoundError
-------------------------------------------------------------------------------------- Captured log call --------------------------------------------------------------------------------------
DEBUG    filelock:_api.py:212 Attempting to acquire lock 38837566000 on /tmp/pytest-of-yuri/pytest-3/test_simple_new_b_str_UnixFile0/new/b
_________________________________________________________________________ test_simple[new2/new3/c-Path-UnixFileLock] __________________________________________________________________________

lock_type = <class 'filelock._unix.UnixFileLock'>, path_type = <class 'pathlib.Path'>, filename = 'new2/new3/c'
tmp_path = PosixPath('/tmp/pytest-of-yuri/pytest-3/test_simple_new2_new3_c_Path_U0'), caplog = <_pytest.logging.LogCaptureFixture object at 0x90ae66400>

    @pytest.mark.parametrize("lock_type", [FileLock, SoftFileLock])
    @pytest.mark.parametrize("path_type", [str, PurePath, Path])
    @pytest.mark.parametrize("filename", ["a", "new/b", "new2/new3/c"])
    def test_simple(
        lock_type: type[BaseFileLock],
        path_type: type[str | Path],
        filename: str,
        tmp_path: Path,
        caplog: pytest.LogCaptureFixture,
    ) -> None:
        caplog.set_level(logging.DEBUG)
    
        # test lock creation by passing a `str`
        lock_path = tmp_path / filename
        lock = lock_type(path_type(lock_path))
>       with lock as locked:

tests/test_filelock.py:41: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
/usr/local/lib/python3.9/site-packages/filelock/_api.py:255: in __enter__
    self.acquire()
/usr/local/lib/python3.9/site-packages/filelock/_api.py:213: in acquire
    self._acquire()
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

self = <filelock._unix.UnixFileLock object at 0x90ae66ee0>

    def _acquire(self) -> None:
        open_flags = os.O_RDWR | os.O_CREAT | os.O_TRUNC
>       fd = os.open(self.lock_file, open_flags, self._context.mode)
E       FileNotFoundError: [Errno 2] No such file or directory: '/tmp/pytest-of-yuri/pytest-3/test_simple_new2_new3_c_Path_U0/new2/new3/c'

/usr/local/lib/python3.9/site-packages/filelock/_unix.py:37: FileNotFoundError
-------------------------------------------------------------------------------------- Captured log call --------------------------------------------------------------------------------------
DEBUG    filelock:_api.py:212 Attempting to acquire lock 38837579488 on /tmp/pytest-of-yuri/pytest-3/test_simple_new2_new3_c_Path_U0/new2/new3/c
__________________________________________________________________________ test_simple[new2/new3/c-str-SoftFileLock] __________________________________________________________________________

lock_type = <class 'filelock._soft.SoftFileLock'>, path_type = <class 'str'>, filename = 'new2/new3/c', tmp_path = PosixPath('/tmp/pytest-of-yuri/pytest-3/test_simple_new2_new3_c_str_So0')
caplog = <_pytest.logging.LogCaptureFixture object at 0x8dbf83220>

    @pytest.mark.parametrize("lock_type", [FileLock, SoftFileLock])
    @pytest.mark.parametrize("path_type", [str, PurePath, Path])
    @pytest.mark.parametrize("filename", ["a", "new/b", "new2/new3/c"])
    def test_simple(
        lock_type: type[BaseFileLock],
        path_type: type[str | Path],
        filename: str,
        tmp_path: Path,
        caplog: pytest.LogCaptureFixture,
    ) -> None:
        caplog.set_level(logging.DEBUG)
    
        # test lock creation by passing a `str`
        lock_path = tmp_path / filename
        lock = lock_type(path_type(lock_path))
>       with lock as locked:

tests/test_filelock.py:41: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
/usr/local/lib/python3.9/site-packages/filelock/_api.py:255: in __enter__
    self.acquire()
/usr/local/lib/python3.9/site-packages/filelock/_api.py:213: in acquire
    self._acquire()
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

self = <filelock._soft.SoftFileLock object at 0x905e88100>

    def _acquire(self) -> None:
        raise_on_not_writable_file(self.lock_file)
        # first check for exists and read-only mode as the open will mask this case as EEXIST
        flags = (
            os.O_WRONLY  # open for writing only
            | os.O_CREAT
            | os.O_EXCL  # together with above raise EEXIST if the file specified by filename exists
            | os.O_TRUNC  # truncate the file to zero byte
        )
        try:
>           file_handler = os.open(self.lock_file, flags, self._context.mode)
E           FileNotFoundError: [Errno 2] No such file or directory: '/tmp/pytest-of-yuri/pytest-3/test_simple_new2_new3_c_str_So0/new2/new3/c'

/usr/local/lib/python3.9/site-packages/filelock/_soft.py:26: FileNotFoundError
-------------------------------------------------------------------------------------- Captured log call --------------------------------------------------------------------------------------
DEBUG    filelock:_api.py:212 Attempting to acquire lock 38753829120 on /tmp/pytest-of-yuri/pytest-3/test_simple_new2_new3_c_str_So0/new2/new3/c
____________________________________________________________________________ test_simple[new/b-Path-UnixFileLock] _____________________________________________________________________________

lock_type = <class 'filelock._unix.UnixFileLock'>, path_type = <class 'pathlib.Path'>, filename = 'new/b', tmp_path = PosixPath('/tmp/pytest-of-yuri/pytest-3/test_simple_new_b_Path_UnixFil0')
caplog = <_pytest.logging.LogCaptureFixture object at 0x90ae57100>

    @pytest.mark.parametrize("lock_type", [FileLock, SoftFileLock])
    @pytest.mark.parametrize("path_type", [str, PurePath, Path])
    @pytest.mark.parametrize("filename", ["a", "new/b", "new2/new3/c"])
    def test_simple(
        lock_type: type[BaseFileLock],
        path_type: type[str | Path],
        filename: str,
        tmp_path: Path,
        caplog: pytest.LogCaptureFixture,
    ) -> None:
        caplog.set_level(logging.DEBUG)
    
        # test lock creation by passing a `str`
        lock_path = tmp_path / filename
        lock = lock_type(path_type(lock_path))
>       with lock as locked:

tests/test_filelock.py:41: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
/usr/local/lib/python3.9/site-packages/filelock/_api.py:255: in __enter__
    self.acquire()
/usr/local/lib/python3.9/site-packages/filelock/_api.py:213: in acquire
    self._acquire()
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

self = <filelock._unix.UnixFileLock object at 0x90ae57d30>

    def _acquire(self) -> None:
        open_flags = os.O_RDWR | os.O_CREAT | os.O_TRUNC
>       fd = os.open(self.lock_file, open_flags, self._context.mode)
E       FileNotFoundError: [Errno 2] No such file or directory: '/tmp/pytest-of-yuri/pytest-3/test_simple_new_b_Path_UnixFil0/new/b'

/usr/local/lib/python3.9/site-packages/filelock/_unix.py:37: FileNotFoundError
-------------------------------------------------------------------------------------- Captured log call --------------------------------------------------------------------------------------
DEBUG    filelock:_api.py:212 Attempting to acquire lock 38837517616 on /tmp/pytest-of-yuri/pytest-3/test_simple_new_b_Path_UnixFil0/new/b
_____________________________________________________________________________ test_simple[new/b-str-SoftFileLock] _____________________________________________________________________________

lock_type = <class 'filelock._soft.SoftFileLock'>, path_type = <class 'str'>, filename = 'new/b', tmp_path = PosixPath('/tmp/pytest-of-yuri/pytest-3/test_simple_new_b_str_SoftFile0')
caplog = <_pytest.logging.LogCaptureFixture object at 0x905e73970>

    @pytest.mark.parametrize("lock_type", [FileLock, SoftFileLock])
    @pytest.mark.parametrize("path_type", [str, PurePath, Path])
    @pytest.mark.parametrize("filename", ["a", "new/b", "new2/new3/c"])
    def test_simple(
        lock_type: type[BaseFileLock],
        path_type: type[str | Path],
        filename: str,
        tmp_path: Path,
        caplog: pytest.LogCaptureFixture,
    ) -> None:
        caplog.set_level(logging.DEBUG)
    
        # test lock creation by passing a `str`
        lock_path = tmp_path / filename
        lock = lock_type(path_type(lock_path))
>       with lock as locked:

tests/test_filelock.py:41: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
/usr/local/lib/python3.9/site-packages/filelock/_api.py:255: in __enter__
    self.acquire()
/usr/local/lib/python3.9/site-packages/filelock/_api.py:213: in acquire
    self._acquire()
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

self = <filelock._soft.SoftFileLock object at 0x8ddb58af0>

    def _acquire(self) -> None:
        raise_on_not_writable_file(self.lock_file)
        # first check for exists and read-only mode as the open will mask this case as EEXIST
        flags = (
            os.O_WRONLY  # open for writing only
            | os.O_CREAT
            | os.O_EXCL  # together with above raise EEXIST if the file specified by filename exists
            | os.O_TRUNC  # truncate the file to zero byte
        )
        try:
>           file_handler = os.open(self.lock_file, flags, self._context.mode)
E           FileNotFoundError: [Errno 2] No such file or directory: '/tmp/pytest-of-yuri/pytest-3/test_simple_new_b_str_SoftFile0/new/b'

/usr/local/lib/python3.9/site-packages/filelock/_soft.py:26: FileNotFoundError
-------------------------------------------------------------------------------------- Captured log call --------------------------------------------------------------------------------------
DEBUG    filelock:_api.py:212 Attempting to acquire lock 38079400688 on /tmp/pytest-of-yuri/pytest-3/test_simple_new_b_str_SoftFile0/new/b
=================================================================================== short test summary info ===================================================================================
SKIPPED [20] tests/test_filelock.py:105: Windows only
========================================================================= 12 failed, 62 passed, 20 skipped in 11.23s ==========================================================================
*** Error code 1

python-3.9
FreeBSD 13.2

We do not support custom test suite runners. PR welcome but we don't track or support FreeBSD expcitely.