[Django] #35952: Internal test runner requirement for TransactionTestCase to set available_apps raises TypeError

15 views
Skip to first unread message

Django

unread,
Nov 29, 2024, 8:49:09 AM11/29/24
to django-...@googlegroups.com
#35952: Internal test runner requirement for TransactionTestCase to set
available_apps raises TypeError
-------------------------------------+-------------------------------------
Reporter: Jacob | Owner: Jake Howard
Walls |
Type: | Status: assigned
Cleanup/optimization |
Component: Testing | Version: dev
framework |
Severity: Normal | Keywords:
Triage Stage: | Has patch: 1
Unreviewed |
Needs documentation: 0 | Needs tests: 0
Patch needs improvement: 0 | Easy pickings: 0
UI/UX: 0 |
-------------------------------------+-------------------------------------
Reported by Jake Howard in [https://github.com/django/django/pull/18628
PR]:

The internal test runner (`runtests.py`) requires that `available_apps` be
set as a class attribute on `TransactionTestCase` subclasses, but
accomplishes this with a `property`. After
8eca3e9bce519c21340312ee7846c92b27abea79, it needs to be a
`classproperty`.

To reproduce, alter one of Django's `TransactionTestCase` subclasses to
remove the `available_apps` attribute:
{{{
------------------
Traceback (most recent call last):
File "/Users/.../django/django/apps/registry.py", line 318, in
set_available_apps
available = set(available)
TypeError: 'property' object is not iterable
}}}

Regression in 8eca3e9bce519c21340312ee7846c92b27abea79, but not marking as
a release blocker or needs tests since this is an internal tool only and
not tested.
--
Ticket URL: <https://code.djangoproject.com/ticket/35952>
Django <https://code.djangoproject.com/>
The web framework for perfectionists with deadlines.

Django

unread,
Nov 29, 2024, 8:52:52 AM11/29/24
to django-...@googlegroups.com
#35952: Internal test runner requirement for TransactionTestCase to set
available_apps raises TypeError
-------------------------------------+-------------------------------------
Reporter: Jacob Walls | Owner: Jake
Type: | Howard
Cleanup/optimization | 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: 1
Easy pickings: 1 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Jacob Walls):

* easy: 0 => 1
* needs_better_patch: 0 => 1
* stage: Unreviewed => Accepted

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

Django

unread,
Nov 29, 2024, 9:30:45 AM11/29/24
to django-...@googlegroups.com
#35952: Internal test runner requirement for TransactionTestCase to set
available_apps raises TypeError
-------------------------------------+-------------------------------------
Reporter: Jacob Walls | Owner: Jake
Type: | Howard
Cleanup/optimization | 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: 1 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Jake Howard):

* needs_better_patch: 1 => 0

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

Django

unread,
Nov 29, 2024, 9:38:31 AM11/29/24
to django-...@googlegroups.com
#35952: Internal test runner requirement for TransactionTestCase to set
available_apps raises TypeError
-------------------------------------+-------------------------------------
Reporter: Jacob Walls | Owner: Jake
Type: | Howard
Cleanup/optimization | 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: 1 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Jacob Walls):

* stage: Accepted => Ready for checkin

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

Django

unread,
Dec 4, 2024, 3:36:50 AM12/4/24
to django-...@googlegroups.com
#35952: Internal test runner requirement for TransactionTestCase to set
available_apps raises TypeError
-------------------------------------+-------------------------------------
Reporter: Jacob Walls | Owner: Jake
Type: | Howard
Cleanup/optimization | 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: 1 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Sarah Boyce <42296566+sarahboyce@…>):

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

Comment:

In [changeset:"58e548db8b74e3d265a2e94816489cd0caeeaf91" 58e548d]:
{{{#!CommitTicketReference repository=""
revision="58e548db8b74e3d265a2e94816489cd0caeeaf91"
Fixed #35952 -- Used class property for available apps check on
TransactionTestCase.
}}}
--
Ticket URL: <https://code.djangoproject.com/ticket/35952#comment:4>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
Reply all
Reply to author
Forward
0 new messages