diff options
| author | Dmitry Dygalo <dadygalo@gmail.com> | 2016-07-20 16:12:13 +0200 |
|---|---|---|
| committer | Tim Graham <timograham@gmail.com> | 2016-07-21 14:01:23 -0400 |
| commit | d7a097265b1842843a73ce0da36ef98bacac8a3e (patch) | |
| tree | 9bdb4e1c3ec4d26d8eb0cc8090a9286da460a57e /tests/test_utils/tests.py | |
| parent | 915786785f6f4439267a513d359c501eddd88266 (diff) | |
Fixed #26922 -- Fixed SimpleTestCase.assertHTMLEqual() crash on Python 3.5+.
Diffstat (limited to 'tests/test_utils/tests.py')
| -rw-r--r-- | tests/test_utils/tests.py | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/tests/test_utils/tests.py b/tests/test_utils/tests.py index fd552ad9c2..395884fedf 100644 --- a/tests/test_utils/tests.py +++ b/tests/test_utils/tests.py @@ -1,6 +1,7 @@ # -*- coding: utf-8 -*- from __future__ import unicode_literals +import sys import unittest import warnings @@ -629,6 +630,15 @@ class HTMLEqualTests(SimpleTestCase): self.assertHTMLEqual('<p>', '') with self.assertRaises(AssertionError): self.assertHTMLEqual('', '<p>') + error_msg = ( + "First argument is not valid HTML:\n" + "('Unexpected end tag `div` (Line 1, Column 6)', (1, 6))" + ) if sys.version_info >= (3, 5) else ( + "First argument is not valid HTML:\n" + "Unexpected end tag `div` (Line 1, Column 6), at line 1, column 7" + ) + with self.assertRaisesMessage(AssertionError, error_msg): + self.assertHTMLEqual('< div></ div>', '<div></div>') with self.assertRaises(HTMLParseError): parse_html('</p>') |
