Opened 10 months ago

Closed 3 weeks ago

#27804 closed Cleanup/optimization (fixed)

Use unittest.subTest() in Django's test suite

Reported by: Tim Graham Owned by:
Component: Core (Other) Version: master
Severity: Normal Keywords:
Cc: Triage Stage: Accepted
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: yes UI/UX: no

Description

With Python 3.4+ support on master, Django's test suite may use unittest.subTest in loops. This makes debugging test failures easier.

Change History (21)

comment:1 Changed 10 months ago by Tim Graham

I made an example change in the second commit of this PR.

comment:2 Changed 10 months ago by Hitesh Bhagchandani

Owner: changed from nobody to Hitesh Bhagchandani
Status: newassigned

comment:3 Changed 10 months ago by Tim Graham <timograham@…>

In f8d52521:

Refs #27804 -- Used subTest() in tests.utils_tests.test_html.

comment:4 Changed 9 months ago by Bruno Alla

Are you still working on this ticket Hitesh, or can I do some work on it?

comment:5 Changed 9 months ago by Bruno Alla

Owner: changed from Hitesh Bhagchandani to Bruno Alla

comment:6 Changed 6 months ago by Tim Graham <timograham@…>

In 6092ea8:

Refs #27804 -- Used subTest() in several tests.

comment:7 Changed 5 months ago by Tim Graham <timograham@…>

In 684c0a35:

Refs #27804 -- Used subTest() in dateparse tests.

comment:8 Changed 5 months ago by Tim Graham <timograham@…>

In ceb5f1c9:

Refs #27804 -- Used subTest() in urlpatterns_reverse tests.

comment:9 Changed 3 months ago by Tim Graham <timograham@…>

In feb1a0a:

Refs #27804 -- Used subTest() in a syndication test.

comment:10 Changed 3 months ago by Tim Graham <timograham@…>

In dea4cfb9:

Refs #27804 -- Used subTest() in a modeladmin test.

comment:11 Changed 2 months ago by Marcin Baranowski

Hi guys :),
are you still working on this ticket? Can I continue?

comment:12 Changed 2 months ago by Bruno Alla

Owner: Bruno Alla deleted
Status: assignednew

comment:13 Changed 2 months ago by Bruno Alla

Nope, go ahead!

comment:14 Changed 2 months ago by Marcin Baranowski

Owner: set to Marcin Baranowski
Status: newassigned

comment:15 Changed 8 weeks ago by Tim Graham <timograham@…>

In f04e6732:

Refs #27804 -- Used subTest() in parse_accept_lang_header() test.

comment:16 Changed 6 weeks ago by Jezeniel Zapanta

Is this still being worked on? I could continue this and for my first contribution.

comment:17 Changed 6 weeks ago by Marcin Baranowski

Hi Jezeniel, I'm still working on this ticket.

comment:18 Changed 5 weeks ago by Marcin Baranowski

Owner: Marcin Baranowski deleted
Status: assignednew

comment:19 Changed 3 weeks ago by Ariel Ferdman

Owner: set to Ariel Ferdman
Status: newassigned

comment:20 Changed 3 weeks ago by Ariel Ferdman

Owner: Ariel Ferdman deleted
Status: assignednew

comment:21 Changed 3 weeks ago by Tim Graham

Resolution: fixed
Status: newclosed

There may be some additional places to update but we can update them as they are spotted rather than leaving this ticket open.

Note: See TracTickets for help on using tickets.
Back to Top