Skip to content

Commit

Permalink
disable test which does no longer raise under python >= 3.12
Browse files Browse the repository at this point in the history
  • Loading branch information
sim0nx committed Oct 2, 2024
1 parent 81e821d commit f0069af
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions tests/test_emlparser.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import email.utils
import json
import pathlib
import platform
import typing
from email.headerregistry import Address
from email.message import EmailMessage
Expand Down Expand Up @@ -257,9 +258,14 @@ def test_headeremail2list_2(self) -> None:

msg = email.message_from_bytes(raw_email, policy=email.policy.default)

# just to be sure we still hit bug 27257 (else there is no more need for the workaround)
with pytest.raises(AttributeError):
msg.items()
python_version_tuple = platform.python_version_tuple()
if python_version_tuple[0] == '3' and int(python_version_tuple[1]) < 12:
# Just to be sure we still hit bug 27257 (else there is no more need for the workaround)
# This should no longer raise under Python >= 3.12
with pytest.raises(AttributeError):
msg.items()
else:
assert msg.items()

ep = eml_parser.EmlParser()
ep.msg = msg
Expand Down

0 comments on commit f0069af

Please sign in to comment.