Opened 8 years ago

Closed 7 years ago

Last modified 4 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 by Tim Graham, 8 years ago

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

comment:2 by Hitesh Bhagchandani, 8 years ago

Owner: changed from nobody to Hitesh Bhagchandani
Status: newassigned

comment:3 by Tim Graham <timograham@…>, 8 years ago

In f8d52521:

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

comment:4 by Bruno Alla, 8 years ago

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

comment:5 by Bruno Alla, 8 years ago

Owner: changed from Hitesh Bhagchandani to Bruno Alla

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

In 6092ea8:

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

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

In 684c0a35:

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

comment:8 by Tim Graham <timograham@…>, 7 years ago

In ceb5f1c9:

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

comment:9 by Tim Graham <timograham@…>, 7 years ago

In feb1a0a:

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

comment:10 by Tim Graham <timograham@…>, 7 years ago

In dea4cfb9:

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

comment:11 by Marcin Baranowski, 7 years ago

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

comment:12 by Bruno Alla, 7 years ago

Owner: Bruno Alla removed
Status: assignednew

comment:13 by Bruno Alla, 7 years ago

Nope, go ahead!

comment:14 by Marcin Baranowski, 7 years ago

Owner: set to Marcin Baranowski
Status: newassigned

comment:15 by Tim Graham <timograham@…>, 7 years ago

In f04e6732:

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

comment:16 by Jezeniel Zapanta, 7 years ago

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

comment:17 by Marcin Baranowski, 7 years ago

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

comment:18 by Marcin Baranowski, 7 years ago

Owner: Marcin Baranowski removed
Status: assignednew

comment:19 by Ariel Ferdman, 7 years ago

Owner: set to Ariel Ferdman
Status: newassigned

comment:20 by Ariel Ferdman, 7 years ago

Owner: Ariel Ferdman removed
Status: assignednew

comment:21 by Tim Graham, 7 years ago

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 by Tim Graham <timograham@…>, 6 years ago

In f5e7506:

Refs #27804 -- Used subTest in AdminViewPermissionsTest.

comment:23 by Tim Graham <timograham@…>, 6 years ago

In 10b0fd1:

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

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

In de6d3afb:

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

comment:25 by Mariusz Felisiak <felisiak.mariusz@…>, 5 years ago

In 49809237:

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

comment:26 by Mariusz Felisiak <felisiak.mariusz@…>, 5 years ago

In e065b29:

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

comment:27 by Carlton Gibson <carlton.gibson@…>, 5 years ago

In 5dac63b:

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

comment:28 by GitHub <noreply@…>, 4 years ago

In f47d5aa:

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

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