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
What was the outcome?
Once this code is loaded by pytest, it no longer deletes the instance of TestmonData and consequently its db (apparently, Python does not promise __del__ will ever be called unless an instance is explicitly deleted). In result, the sqlite connection is not flushed. The .testmondata will still recover on the next run, but when trying to archive it (as part of CI), it makes a bit frustrating to have to carry its -wal and -shm files as well.
What did you expect instead?
.testmondata to be flushed. Probably simplest to makeTestmonData.close_connection() explicitly close the sqlite3 connection.
What is your operating system and it's version please?
macOS 11.7
The text was updated successfully, but these errors were encountered:
What is your setup and what steps did you do?
The easiest way to reproduce is to run
pytest --testmon
in an environment that has:pytest==8.2.2
pytest-mock==3.14.0
pytest-testmon==2.1.1
I tried to make it even smaller and found that this reduced part of pytest-mock is enough to cause trouble:
What was the outcome?
Once this code is loaded by pytest, it no longer deletes the instance of
TestmonData
and consequently itsdb
(apparently, Python does not promise__del__
will ever be called unless an instance is explicitly deleted). In result, the sqlite connection is not flushed. The.testmondata
will still recover on the next run, but when trying to archive it (as part of CI), it makes a bit frustrating to have to carry its -wal and -shm files as well.What did you expect instead?
.testmondata to be flushed. Probably simplest to make
TestmonData.close_connection()
explicitly close the sqlite3 connection.What is your operating system and it's version please?
macOS 11.7
The text was updated successfully, but these errors were encountered: