Skip to content

Commit 94499f7

Browse files
committed
Fix for Fix test assertions to work across Python ver. 3.11 & 3.12
The HTTP 413 status message differs between Python versions: - Python 3.13: "Content Too Large" - Python 3.11: "Request Entity Too Large" Updated test assertions to use assertIn("HTTP 413:") instead of exact string matching to ensure tests pass across supported Python versions while still verifying that HTTP status context is properly added to XML parsing errors.
1 parent 63b1b27 commit 94499f7

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

tests/unit/test_parsers.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1640,7 +1640,7 @@ def test_query_parser_empty_body_4xx_error_with_notes(self):
16401640

16411641
self.assertTrue(hasattr(exception, '__notes__'))
16421642
self.assertEqual(len(exception.__notes__), 1)
1643-
self.assertEqual(exception.__notes__[0], "HTTP 413: Content Too Large")
1643+
self.assertIn("HTTP 413:", exception.__notes__[0])
16441644

16451645
def test_parse_error_from_body_empty_body_4xx_error_with_notes(self):
16461646
parser = parsers.RestXMLParser()
@@ -1661,7 +1661,7 @@ def test_parse_error_from_body_empty_body_4xx_error_with_notes(self):
16611661

16621662
self.assertTrue(hasattr(exception, '__notes__'))
16631663
self.assertEqual(len(exception.__notes__), 1)
1664-
self.assertEqual(exception.__notes__[0], "HTTP 413: Content Too Large")
1664+
self.assertIn("HTTP 413:", exception.__notes__[0])
16651665

16661666

16671667
def _generic_test_bodies():

0 commit comments

Comments
 (0)