[Django] #34731: Django test suite still has an occurence of assertEquals, removed in Python 3.12

82 views
Skip to first unread message

Django

unread,
Jul 21, 2023, 2:39:08 PM7/21/23
to django-...@googlegroups.com
#34731: Django test suite still has an occurence of assertEquals, removed in Python
3.12
---------------------------------------------+------------------------
Reporter: michel-slm | Owner: nobody
Type: Bug | Status: new
Component: Testing framework | Version: dev
Severity: Normal | Keywords:
Triage Stage: Unreviewed | Has patch: 1
Needs documentation: 0 | Needs tests: 0
Patch needs improvement: 0 | Easy pickings: 0
UI/UX: 0 |
---------------------------------------------+------------------------
Python 3.12, shipping in the upcoming Fedora 39, finally removed the
deprecated `assertEquals` in favor of `assertEqual`. The Django test suite
mostly use the latter already, but there is one occurence of the former
left. It should be converted.

--
Ticket URL: <https://code.djangoproject.com/ticket/34731>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

Django

unread,
Jul 21, 2023, 2:43:15 PM7/21/23
to django-...@googlegroups.com
#34731: Django test suite still has an occurence of assertEquals, removed in Python
3.12
-----------------------------------+--------------------------------------
Reporter: michel-slm | Owner: michel-slm
Type: Bug | Status: assigned

Component: Testing framework | Version: dev
Severity: Normal | Resolution:

Keywords: | Triage Stage: Unreviewed
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-----------------------------------+--------------------------------------
Changes (by michel-slm):

* owner: nobody => michel-slm
* status: new => assigned


Comment:

PR: https://github.com/django/django/pull/17103

--
Ticket URL: <https://code.djangoproject.com/ticket/34731#comment:1>

Django

unread,
Jul 21, 2023, 2:44:46 PM7/21/23
to django-...@googlegroups.com
#34731: Django test suite still has an occurence of assertEquals, removed in Python
3.12
-----------------------------------+--------------------------------------
Reporter: michel-slm | Owner: michel-slm
Type: Bug | Status: assigned
Component: Testing framework | Version: dev
Severity: Normal | Resolution:
Keywords: | Triage Stage: Unreviewed
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-----------------------------------+--------------------------------------
Description changed by michel-slm:

Old description:

> Python 3.12, shipping in the upcoming Fedora 39, finally removed the
> deprecated `assertEquals` in favor of `assertEqual`. The Django test
> suite mostly use the latter already, but there is one occurence of the
> former left. It should be converted.

New description:

Python 3.12, shipping in the upcoming Fedora 39, finally removed the
deprecated `assertEquals` in favor of `assertEqual`. The Django test suite
mostly use the latter already, but there is one occurence of the former
left. It should be converted.

Test failure on Python 3.12:


{{{
======================================================================
ERROR: test_condition_with_func_and_lookup_outside_relation_name
(filtered_relation.tests.FilteredRelationTests.test_condition_with_
func_and_lookup_outside_relation_name)
----------------------------------------------------------------------
Traceback (most recent call last):
File
"/home/michel/src/github/django/django/tests/filtered_relation/tests.py",
line 652, in test_condition_with_func_and_lookup_ou
tside_relation_name
self.assertEquals(qs.count(), 1)
^^^^^^^^^^^^^^^^^
AttributeError: 'FilteredRelationTests' object has no attribute
'assertEquals'. Did you mean: 'assertEqual'?

}}}

--

--
Ticket URL: <https://code.djangoproject.com/ticket/34731#comment:2>

Django

unread,
Jul 21, 2023, 2:46:04 PM7/21/23
to django-...@googlegroups.com
#34731: Django test suite still has an occurence of assertEquals, removed in Python
3.12
-----------------------------------+--------------------------------------
Reporter: michel-slm | Owner: michel-slm
Type: Bug | Status: assigned
Component: Testing framework | Version: dev
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted

Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-----------------------------------+--------------------------------------
Changes (by Mariusz Felisiak):

* stage: Unreviewed => Accepted


Comment:

Good catch, my bad.

--
Ticket URL: <https://code.djangoproject.com/ticket/34731#comment:3>

Django

unread,
Jul 21, 2023, 2:51:55 PM7/21/23
to django-...@googlegroups.com
#34731: Django test suite still has an occurence of assertEquals, removed in Python
3.12
-------------------------------------+-------------------------------------
Reporter: Michel Alexandre | Owner: Michel
Salim | Alexandre Salim

Type: Bug | Status: assigned
Component: Testing framework | Version: dev
Severity: Normal | Resolution:
Keywords: | Triage Stage: Ready for
| checkin

Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Mariusz Felisiak):

* stage: Accepted => Ready for checkin


--
Ticket URL: <https://code.djangoproject.com/ticket/34731#comment:4>

Django

unread,
Jul 21, 2023, 3:18:33 PM7/21/23
to django-...@googlegroups.com
#34731: Django test suite still has an occurence of assertEquals, removed in Python
3.12
-------------------------------------+-------------------------------------
Reporter: michel-slm | Owner: michel-
| slm
Type: Bug | Status: closed

Component: Testing framework | Version: dev
Severity: Normal | Resolution: fixed

Keywords: | Triage Stage: Ready for
| checkin
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by GitHub <noreply@…>):

* status: assigned => closed
* resolution: => fixed


Comment:

In [changeset:"62b83889e066b8270854f7560e0498944efd7689" 62b83889]:
{{{
#!CommitTicketReference repository=""
revision="62b83889e066b8270854f7560e0498944efd7689"
Fixed #34731, Refs #34118 -- Replaced assertEquals() with assertEqual() in
test_condition_with_func_and_lookup_outside_relation_name().

Signed-off-by: Michel Alexandre Salim <sal...@fedoraproject.org>
}}}

--
Ticket URL: <https://code.djangoproject.com/ticket/34731#comment:5>

Reply all
Reply to author
Forward
0 new messages