Skip to content

Commit

Permalink
handle logging version differences
Browse files Browse the repository at this point in the history
  • Loading branch information
danielrichman committed Nov 21, 2014
1 parent dc0e8a9 commit 3703d06
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion habitat/tests/test_utils/test_startup.py
Expand Up @@ -232,7 +232,11 @@ def check_email(self, level, level_name):
self.mocker.StubOutClassWithMocks(smtplib, 'SMTP')

for things in self.expected_messages(level):
smtp = smtplib.SMTP("email_server", 25, timeout=5.0)
if sys.version_info >= (2, 7, 3):
kwargs = {"timeout": 5.0}
else:
kwargs = {}
smtp = smtplib.SMTP("email_server", 25, **kwargs)
smtp.sendmail("from_bob", ["addr_1", "addr_2"], EqIfIn(*things))
smtp.quit()

Expand Down

0 comments on commit 3703d06

Please sign in to comment.