Skip to content

Commit 46642d5

Browse files
committed
Use a Bunch instead of dict for nicer property access.
1 parent b2b23d7 commit 46642d5

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

pytest_localserver/smtp.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,13 @@ def process_message(self, peer, mailfrom, rcpttos, data, **kwargs):
5252
except AttributeError:
5353
message = email.message_from_string(data)
5454
# on the message, also set the envelope details
55-
message.details = dict(
55+
56+
class Bunch:
57+
def __init__(self, **kwds):
58+
vars(self).update(kwds)
59+
60+
message.details = lambda: None
61+
Bunch(
5662
peer=peer,
5763
mailfrom=mailfrom,
5864
rcpttos=rcpttos,

0 commit comments

Comments
 (0)