From 3c9537d506568272f0a8469f8336bd944c6841bf Mon Sep 17 00:00:00 2001 From: Sofian Brabez Date: Wed, 14 Dec 2016 20:57:55 +0100 Subject: Avoid PacketizerTest.test_closed_3 to fail on platforms where errno.ETIME is not defined This changes define the proper Timer expired error message instead of raising AttributeError when errno.ETIME is not available on the platform. fixes #862 --- tests/test_packetizer.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/tests/test_packetizer.py b/tests/test_packetizer.py index a1ea398c..02173292 100644 --- a/tests/test_packetizer.py +++ b/tests/test_packetizer.py @@ -114,9 +114,13 @@ class PacketizerTest (unittest.TestCase): import signal class TimeoutError(Exception): - pass + def __init__(self, error_message): + if hasattr(errno, 'ETIME'): + self.message = os.sterror(errno.ETIME) + else: + self.messaage = error_message - def timeout(seconds=1, error_message=os.strerror(errno.ETIME)): + def timeout(seconds=1, error_message='Timer expired'): def decorator(func): def _handle_timeout(signum, frame): raise TimeoutError(error_message) -- cgit v1.2.3 From 168b8b383efc894cfa8d81946e524a639326f413 Mon Sep 17 00:00:00 2001 From: Jeff Forcier Date: Mon, 20 Feb 2017 14:46:27 -0800 Subject: Changelog closes #863 --- sites/www/changelog.rst | 3 +++ 1 file changed, 3 insertions(+) diff --git a/sites/www/changelog.rst b/sites/www/changelog.rst index 22681f49..c79ffba8 100644 --- a/sites/www/changelog.rst +++ b/sites/www/changelog.rst @@ -2,6 +2,9 @@ Changelog ========= +* :bug:`862 (1.17+)` (via :issue:`863`) Avoid test suite exceptions on + platforms lacking ``errno.ETIME`` (which seems to be some FreeBSD and some + Windows environments.) Thanks to Sofian Brabez. * :bug:`44 (1.17+)` (via :issue:`891`) `SSHClient ` now gives its internal `Transport ` a handle on itself, preventing garbage collection of the client until the session is -- cgit v1.2.3