From de6d3afb97454e0653d55adadcf0df7e2a03c088 Mon Sep 17 00:00:00 2001 From: Jon Dufresne Date: Thu, 9 May 2019 08:17:42 -0700 Subject: [PATCH] Refs #27804 -- Used subTest() in HTMLEqualTests.test_self_closing_tags. --- tests/test_utils/tests.py | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/tests/test_utils/tests.py b/tests/test_utils/tests.py index 5b84bbd383f..c14746f3443 100644 --- a/tests/test_utils/tests.py +++ b/tests/test_utils/tests.py @@ -542,17 +542,18 @@ class HTMLEqualTests(SimpleTestCase): 'base', 'col', ) for tag in self_closing_tags: - dom = parse_html('

Hello <%s> world

' % tag) - self.assertEqual(len(dom.children), 3) - self.assertEqual(dom[0], 'Hello') - self.assertEqual(dom[1].name, tag) - self.assertEqual(dom[2], 'world') + with self.subTest(tag): + dom = parse_html('

Hello <%s> world

' % tag) + self.assertEqual(len(dom.children), 3) + self.assertEqual(dom[0], 'Hello') + self.assertEqual(dom[1].name, tag) + self.assertEqual(dom[2], 'world') - dom = parse_html('

Hello <%s /> world

' % tag) - self.assertEqual(len(dom.children), 3) - self.assertEqual(dom[0], 'Hello') - self.assertEqual(dom[1].name, tag) - self.assertEqual(dom[2], 'world') + dom = parse_html('

Hello <%s /> world

' % tag) + self.assertEqual(len(dom.children), 3) + self.assertEqual(dom[0], 'Hello') + self.assertEqual(dom[1].name, tag) + self.assertEqual(dom[2], 'world') def test_simple_equal_html(self): self.assertHTMLEqual('', '')