Opened 7 years ago

Closed 6 years ago

Last modified 3 years ago

#27804 closed Cleanup/optimization (fixed)

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

Reported by: Tim Graham Owned by:
Component: Core (Other) Version: dev
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 (28)

comment:1 Changed 7 years ago by Tim Graham

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

comment:2 Changed 7 years ago by Hitesh Bhagchandani

Owner: changed from nobody to Hitesh Bhagchandani
Status: newassigned

comment:3 Changed 7 years ago by Tim Graham <timograham@…>

In f8d52521:

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

comment:4 Changed 7 years ago by Bruno Alla

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

comment:5 Changed 7 years ago by Bruno Alla

Owner: changed from Hitesh Bhagchandani to Bruno Alla

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

In 6092ea8:

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

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

In 684c0a35:

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

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

In ceb5f1c9:

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

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

In feb1a0a:

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

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

In dea4cfb9:

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

comment:11 Changed 6 years ago by Marcin Baranowski

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

comment:12 Changed 6 years ago by Bruno Alla

Owner: Bruno Alla deleted
Status: assignednew

comment:13 Changed 6 years ago by Bruno Alla

Nope, go ahead!

comment:14 Changed 6 years ago by Marcin Baranowski

Owner: set to Marcin Baranowski
Status: newassigned

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

In f04e6732:

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

comment:16 Changed 6 years ago by Jezeniel Zapanta

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

comment:17 Changed 6 years ago by Marcin Baranowski

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

comment:18 Changed 6 years ago by Marcin Baranowski

Owner: Marcin Baranowski deleted
Status: assignednew

comment:19 Changed 6 years ago by Ariel Ferdman

Owner: set to Ariel Ferdman
Status: newassigned

comment:20 Changed 6 years ago by Ariel Ferdman

Owner: Ariel Ferdman deleted
Status: assignednew

comment:21 Changed 6 years 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.

comment:22 Changed 5 years ago by Tim Graham <timograham@…>

In f5e7506:

Refs #27804 -- Used subTest in AdminViewPermissionsTest.

comment:23 Changed 5 years ago by Tim Graham <timograham@…>

In 10b0fd1:

Refs #27804 -- Used subTest() in admin_scripts invalid name tests.

comment:24 Changed 5 years ago by Carlton Gibson <carlton.gibson@…>

In de6d3afb:

Refs #27804 -- Used subTest() in HTMLEqualTests.test_self_closing_tags.

comment:25 Changed 4 years ago by Mariusz Felisiak <felisiak.mariusz@…>

In 49809237:

Refs #27804 -- Used subTest() in BinaryFieldTests.test_set_and_retrieve.

comment:26 Changed 4 years ago by Mariusz Felisiak <felisiak.mariusz@…>

In e065b29:

Refs #27804 -- Used subTest() in filesizeformat tests and HumanizeTests.

comment:27 Changed 4 years ago by Carlton Gibson <carlton.gibson@…>

In 5dac63b:

Refs #27804 -- Used subTest() in utils_tests/test_encoding.py.

comment:28 Changed 3 years ago by GitHub <noreply@…>

In f47d5aa:

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

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