You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If someone where to introduce a bug (such as reintroducing #31) that caused file locking
not to secure exclusive access, no test actually fails. Instead, a warning is shown by Pytest:
(do to the nature of this kind of bug, it seems sometimes this would succeed with no warning at all)
tests/test_error.py .... [ 8%]
tests/test_filelock.py .............................................. [100%]
========================================================================= warnings summary ==========================================================================
tests/test_filelock.py::test_threaded_lock_different_lock_obj[UnixFileLock]
.../site-packages/_pytest/threadexception.py:73: PytestUnhandledThreadExceptionWarning: Exception in thread t2_8
Traceback (most recent call last):
File ".../threading.py", line 1038, in _bootstrap_inner
self.run()
File "py-filelock/tests/test_filelock.py", line 187, in run
super().run()
File ".../threading.py", line 975, in run
self._target(*self._args, **self._kwargs)
File "py-filelock/tests/test_filelock.py", line 234, in t_2
assert not lock_1.is_locked
AssertionError: assert not True
+ where True = <filelock._unix.UnixFileLock object at 0x1030ef3d0>.is_locked
warnings.warn(pytest.PytestUnhandledThreadExceptionWarning(msg))
-- Docs: https://docs.pytest.org/en/stable/how-to/capture-warnings.html
=================================================================== 50 passed, 1 warning in 3.53s ===================================================================
Results found by adding the follow to py-filelock/src/filelock/_unix.py > UnixFileLock > _release
The issue seems to be that the test test_filelock.py::test_threaded_lock_different_lock_obj[UnixFileLock] is failing with a AssertionError exception. However, only RuntimeError's are caught in threads created during the testing process.
There is a potential issue in test_filelock.py
If someone where to introduce a bug (such as reintroducing #31) that caused file locking
not to secure exclusive access, no test actually fails. Instead, a warning is shown by Pytest:
(do to the nature of this kind of bug, it seems sometimes this would succeed with no warning at all)
Results found by adding the follow to
py-filelock/src/filelock/_unix.py > UnixFileLock > _release
The issue seems to be that the test
test_filelock.py::test_threaded_lock_different_lock_obj[UnixFileLock]
is failing with aAssertionError
exception. However, onlyRuntimeError
's are caught in threads created during the testing process.https://github.com/tox-dev/py-filelock/blob/b815134c9bc62aecbe2d8b85a875690d55df5667/tests/test_filelock.py#L185-L189
The text was updated successfully, but these errors were encountered: