Your message dated Wed, 12 Jun 2024 22:49:25 +0000
with message-id <[email protected]>
and subject line Bug#1072810: fixed in pytest 8.2.2-2
has caused the Debian Bug report #1072810,
regarding pytest 8 regression with flaky test plugins
to be marked as done.
This means that you claim that the problem has been dealt with.
If this is not the case it is now your responsibility to reopen the
Bug report if necessary, and/or fix the problem forthwith.
(NB: If you are a system administrator and have no idea what this
message is talking about, this may indicate a serious mail system
misconfiguration somewhere. Please contact [email protected]
immediately.)
--
1072810: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1072810
Debian Bug Tracking System
Contact [email protected] with problems
--- Begin Message ---
Package: pytest
Version: 8.2.2-1
Severity: important
Tags: patch
X-Debbugs-Cc: [email protected]
User: [email protected]
Usertags: origin-ubuntu oracular ubuntu-patch
Hi,
Pytest 8.2.2 introduced a regression in flaky test plugins (e.g.
pytest-rerunfailures and python-flaky) that causes AssertionErrors when
re-running tests in test classes which inherit from unittest.TestCase.
I applied the following patch in Ubuntu to fix the issue.
* 0003-pytest8-testcase-assertion.patch: Fixes unittest regression in
flaky test plugins (LP: #2068642).
Thanks for considering the patch.
-- System Information:
Debian Release: trixie/sid
APT prefers oracular
APT policy: (500, 'oracular'), (100, 'oracular-proposed')
Architecture: amd64 (x86_64)
Kernel: Linux 6.8.0-31-generic (SMP w/16 CPU threads; PREEMPT)
Kernel taint flags: TAINT_PROPRIETARY_MODULE, TAINT_OOT_MODULE
Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8), LANGUAGE not set
Shell: /bin/sh linked to /usr/bin/dash
Init: systemd (via /run/systemd/system)
LSM: AppArmor: enabled
diff -Nru pytest-8.2.2/debian/patches/0003-pytest8-testcase-assertion.patch
pytest-8.2.2/debian/patches/0003-pytest8-testcase-assertion.patch
--- pytest-8.2.2/debian/patches/0003-pytest8-testcase-assertion.patch
1969-12-31 16:00:00.000000000 -0800
+++ pytest-8.2.2/debian/patches/0003-pytest8-testcase-assertion.patch
2024-06-07 15:23:04.000000000 -0700
@@ -0,0 +1,48 @@
+Description: Fix unittest regressions for flaky test plugins
+ A change in the behavior of the unittest teardown function caused a
+ regression in plugins that re-ran tests. Namely python-flaky and
+ pytest-rerunfailures. This patch was cherry-picked from an upstream
+ PR.
+Origin: upstream, https://github.com/pytest-dev/pytest/pull/12436
+Bug: https://github.com/pytest-dev/pytest/issues/12424
+Bug-Ubuntu: https://bugs.launchpad.net/ubuntu/+source/pytest/+bug/2068642
+Forwarded: not-needed
+Last-Update: 2024-06-07
+---
+This patch header follows DEP-3: http://dep.debian.net/deps/dep3/
+--- a/src/_pytest/unittest.py
++++ b/src/_pytest/unittest.py
+@@ -216,7 +216,7 @@
+ self._explicit_tearDown()
+ self._explicit_tearDown = None
+ self._obj = None
+- self._instance = None
++ del self._instance
+ super().teardown()
+
+ def startTest(self, testcase: "unittest.TestCase") -> None:
+--- /dev/null
++++ b/testing/plugins_integration/pytest_rerunfailures_integration.py
+@@ -0,0 +1,11 @@
++import unittest
++
++
++class MyTestCase(unittest.TestCase):
++ first_time = True
++
++ def test_fail_the_first_time(self) -> None:
++ """Regression test for issue #12424."""
++ if self.first_time:
++ type(self).first_time = False
++ self.fail()
+--- a/tox.ini
++++ b/tox.ini
+@@ -143,7 +143,7 @@
+ pytest --cov=. simple_integration.py
+ pytest --ds=django_settings simple_integration.py
+ pytest --html=simple.html simple_integration.py
+- pytest --reruns 5 simple_integration.py
++ pytest --reruns 5 simple_integration.py
pytest_rerunfailures_integration.py
+ pytest pytest_anyio_integration.py
+ pytest pytest_asyncio_integration.py
+ pytest pytest_mock_integration.py
diff -Nru pytest-8.2.2/debian/patches/series pytest-8.2.2/debian/patches/series
--- pytest-8.2.2/debian/patches/series 2024-06-05 06:34:35.000000000 -0700
+++ pytest-8.2.2/debian/patches/series 2024-06-07 09:09:35.000000000 -0700
@@ -1,2 +1,3 @@
0001-Use-local-intersphinx-mappings.patch
0002-Disable-Sphinx-extensions.patch
+0003-pytest8-testcase-assertion.patch
--- End Message ---
--- Begin Message ---
Source: pytest
Source-Version: 8.2.2-2
Done: Timo Röhling <[email protected]>
We believe that the bug you reported is fixed in the latest version of
pytest, which is due to be installed in the Debian FTP archive.
A summary of the changes between this version and the previous one is
attached.
Thank you for reporting the bug, which will now be closed. If you
have further comments please address them to [email protected],
and the maintainer will reopen the bug report if appropriate.
Debian distribution maintenance software
pp.
Timo Röhling <[email protected]> (supplier of updated pytest package)
(This message was generated automatically at their request; if you
believe that there is a problem with it please contact the archive
administrators by mailing [email protected])
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA512
Format: 1.8
Date: Thu, 13 Jun 2024 00:24:50 +0200
Source: pytest
Architecture: source
Version: 8.2.2-2
Distribution: unstable
Urgency: medium
Maintainer: Debian Python Team <[email protected]>
Changed-By: Timo Röhling <[email protected]>
Closes: 1072810
Changes:
pytest (8.2.2-2) unstable; urgency=medium
.
* Fix test regressions for flaky test plugins.
Thanks to Chris Peterson (Closes: #1072810)
Checksums-Sha1:
62d424c4ca57e115839b0e7b39ce825a717255db 2642 pytest_8.2.2-2.dsc
d8552128dc6d7402149e44d869efc3bf4d78a9be 11876 pytest_8.2.2-2.debian.tar.xz
Checksums-Sha256:
75a956555d8e1294c446892bb42030d0c170c314c533e4b6fd00be6e70887146 2642
pytest_8.2.2-2.dsc
54bc6a67eb1e3419ca04f9d031bc1cab4519cae98d32b1d9d6f67b0dc22a1d46 11876
pytest_8.2.2-2.debian.tar.xz
Files:
d6893e66f94b9824b576b8d6b8c50ade 2642 python optional pytest_8.2.2-2.dsc
fd467076f85b10fb31c45dc87fced6c9 11876 python optional
pytest_8.2.2-2.debian.tar.xz
-----BEGIN PGP SIGNATURE-----
iQJIBAEBCgAyFiEEmwPruYMA35fCsSO/zIxr3RQD9MoFAmZqIhkUHHJvZWhsaW5n
QGRlYmlhbi5vcmcACgkQzIxr3RQD9Mol4g//aSAxqOfmGYBXiQaJ/cC4eErfvbA2
uGe3/sn52LsX4Z3KMIcqZfO4FPrbQrqngjY5LGACNcBSqHZXyVzb4Ej7JZlOv1f1
gtQYxpB6yE/mNf6JIfIrV0Y0Z6zFKYeoztuVmxLGJRocVyXSm/wiM9AFoa+ab0Pu
WIMDE0q+tLcfd5oXU9OKUQ6tq6u/kU6tQ3sf239ReFuMwZPblTpPPT+j5KtEeXvz
BQWZOC1lJS+p2DQ7luw4sMaoi+Csc9GBZwlDGqCgtTjqxmkntvpG2/dZle9LQ+bT
CN+N2ULe8Bt2HXxTLw+EdCmdjD0HWnWk4MTRlSFRBmRAPCJT7nxnA8Clp+Nu1W8g
ClUfYqsb59JkLqs8TVyz9osq4BE9oLs0nvKtpNl8F+ueZuJyEd+B6lKVB3oQradc
YXTWq8WtXuP2ccJ7KWD8twwaZEFjqhSWGDnLWBtLArpavpdxaBm7rQoRODFuIu+J
WzlbmyL336VufjoRPWVXjZ/9freBuAyiiP6ov4jYvXC1pl6au8RxaZvuc7G+Lnqf
ZHWN+QOd0kvlpeac7/+S+XE/mL0o7QfeFHIhsjvzmCY+OSms7W3ApjQnHCp7CIYR
dMJ/92pukjmlyvs7OZDY2/gY1bsHCAk064Ac7mevys2kXV5kdTVLyroPyinFdNGQ
lp46JgAUDQNtV+w=
=ZILv
-----END PGP SIGNATURE-----
pgp0X4k68LutW.pgp
Description: PGP signature
--- End Message ---