#24903 closed Bug (fixed)
Backport assertRaisesMessage fix
Reported by: | Moritz Sichert | Owned by: | Tim Graham |
---|---|---|---|
Component: | Testing framework | Version: | 1.8 |
Severity: | Normal | Keywords: | test assert raises message |
Cc: | Triage Stage: | Accepted | |
Has patch: | yes | Needs documentation: | no |
Needs tests: | no | Patch needs improvement: | no |
Easy pickings: | no | UI/UX: | no |
Description (last modified by )
In https://bugs.python.org/issue24134 cpython changed the behaviour of assertRaises
that breaks django's assertRaisesMessage
.
Unfortunately this bug is not fixed in cpython's 2.7.10 release, so I think the fixes on django's side should be backported at least to 1.8 because right now it's not possible to use assertRaisesMessage
as context manager with 2.7.10.
Following commits contain the fixes on django's side:
c2bc1cefdcbbf074408f4a4cace88b315cf9d652
a0175724b086127a4e13612042961d3ba88d6bd9
e89c3a46035e9fe17c373a6c9cd63b9fd631d596
Change History (10)
comment:1 by , 10 years ago
Description: | modified (diff) |
---|
comment:2 by , 10 years ago
comment:3 by , 10 years ago
$ wget https://www.python.org/ftp/python/2.7.10/Python-2.7.10.tar.xz $ tar -xf Python-2.7.10.tar.xz $ grep -n 'is _sentinel' Python-2.7.10/Lib/unittest/case.py 472: if callableObj is _sentinel: 992: if callable_obj is _sentinel:
I took it straight from the official download, so I think that's the final version.
The changes got reverted here:
https://hg.python.org/cpython/rev/0c93868f202e
Unfortunately that got merged into the 2.7 branch just after the 2.7.10 release.
comment:4 by , 10 years ago
Owner: | changed from | to
---|---|
Status: | new → assigned |
Triage Stage: | Unreviewed → Accepted |
Okay, that's a bit odd. The Windows installer seems to contain the revert but the gzip tarball doesn't. I'll try to figure out what's going on.
comment:5 by , 10 years ago
Has patch: | set |
---|
From bitdancer in #python-dev regarding merging of fixes to the release branches of Python:
the way it is supposed to work is that issue like that get marked as "release blocker" in the tracker, and the release manager makes sure they are dealt with before cutting the release. Things do slip through the cracks, though, and once they do the need to go into NEWS.
And as to why the Windows version contains the fix:
things being different between different builds of the release is a bug in the release process. I'm not sure what happened there.
I'll fix this on 1.8 and 1.7. 1.4 isn't affected. PR
comment:9 by , 9 years ago
I ran into this issue with Django 1.4 on Python 2.7.10 as well. Any chance on merging it into Django 1.4?
comment:10 by , 9 years ago
As Django 1.4 will be unsupported in a month and half (October 1), I don't think it's a priority.
I'm fairly sure that change was reverted in 2.7.10. Are you sure you're running the final version and not the release candidate? Django's test suite passes for me on 2.7.10.