The culprit seems to be pytest setting the test._instance attribute to None instead of deleting the reference. It looks like upstream has the same conclusion [1].
This fixes the issue for python-flaky, but uncovered a separate issue for pytest-rerunfailures. Although there appears to be some related work upstream for this issue as well [2].
Please see the attached debdiff for the proposed fixes in [1] for pytest, which will resolve python-flaky's autopkgtest regression. I will separately look into whether [2] will fix the issue for pytest-rerunfailures.
The culprit seems to be pytest setting the test._instance attribute to None instead of deleting the reference. It looks like upstream has the same conclusion [1].
This fixes the issue for python-flaky, but uncovered a separate issue for pytest- rerunfailures. Although there appears to be some related work upstream for this issue as well [2].
Please see the attached debdiff for the proposed fixes in [1] for pytest, which will resolve python-flaky's autopkgtest regression. I will separately look into whether [2] will fix the issue for pytest- rerunfailures.
PPA: https:/ /launchpad. net/~cpete/ +archive/ ubuntu/ pytest
pytest autopkgtest results: https:/ /autopkgtest. ubuntu. com/results/ autopkgtest- oracular- cpete-pytest/ oracular/ amd64/p/ pytest/ 20240607_ 173550_ 99668@/ log.gz
python-flaky autopkgtest results: https:/ /autopkgtest. ubuntu. com/results/ autopkgtest- oracular- cpete-pytest/ oracular/ amd64/p/ python- flaky/20240607_ 173242_ a6c20@/ log.gz
[1] https:/ /github. com/pytest- dev/pytest/ pull/12436 /github. com/pytest- dev/pytest- rerunfailures/ commit/ 0ab54f00d68bb4f eadae58d2f4e30f 6663495571
[2] https:/