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
The following problem has two objects that reference each other and a __del__ method in one of the classes. pytest-cov incorrectly reports that the __del__ method hasn't been called.
__del__ methods are very difficult. In your case, the method is being called during interpreter shutdown, so possibly after coverage has stopped measurement. They can cause other troubles as well (see the pink warning box at https://docs.python.org/3/reference/datamodel.html#object.__del__). You might want to consider refactoring to avoid the need for __del__.
andymwood
changed the title
__del__ method incorrectly repoted as missing in a problem with circular references
__del__ method incorrectly reported as missing in a problem with circular references
Oct 19, 2023
Summary
The following problem has two objects that reference each other and a
__del__
method in one of the classes. pytest-cov incorrectly reports that the__del__
method hasn't been called.Expected vs actual result
Expected 100% coverage. Get 91% coverage.
Reproducer
Versions
Code
test_module.py:
The text was updated successfully, but these errors were encountered: