Skip to content

Commit

Permalink
Fix test failures
Browse files Browse the repository at this point in the history
  • Loading branch information
srinivasreddy committed Dec 23, 2024
1 parent 32dc6c8 commit 151e146
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions Lib/test/test_email/test_email.py
Original file line number Diff line number Diff line change
Expand Up @@ -749,12 +749,12 @@ def test_invalid_header_names(self):
method=method,
):
message = Message(policy=thispolicy)
method = getattr(message, method)
class_method = getattr(message, method)
with self.assertRaisesRegex(
ValueError,
'(?i)(?=.*invalid)(?=.*header)(?=.*name)'
) as cm:
method(name, value)
class_method(name, value)
self.assertIn(f"{name!r}", str(cm.exception))


Expand Down
4 changes: 2 additions & 2 deletions Lib/test/test_email/test_message.py
Original file line number Diff line number Diff line change
Expand Up @@ -1025,12 +1025,12 @@ def test_invalid_header_names(self):
method=method,
):
message = EmailMessage(policy=thispolicy)
method = getattr(message, method)
class_method = getattr(message, method)
with self.assertRaisesRegex(
ValueError,
'(?i)(?=.*invalid)(?=.*header)(?=.*name)'
) as cm:
method(name,value)
class_method(name,value)
self.assertIn(f"{name!r}", str(cm.exception))

def test_get_body_malformed(self):
Expand Down

0 comments on commit 151e146

Please sign in to comment.