summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorJeff Forcier <jeff@bitprophet.org>2023-01-16 21:25:52 -0500
committerJeff Forcier <jeff@bitprophet.org>2023-01-16 21:33:25 -0500
commit8367147e883583bba71cd660d1bae880a66eb27c (patch)
tree5a40cde0c4f30faf6c66c5cc17919a0bcd577921 /tests
parent53460723a6ab342129ac456ef6a4ba5ef676b577 (diff)
downloadparamiko-8367147e883583bba71cd660d1bae880a66eb27c.tar.gz
Nuke retry_on_signal, pointless on modern Py3
Additionally, other bits of code that retry EINTR can similarly just go away.
Diffstat (limited to 'tests')
-rw-r--r--tests/test_util.py34
1 files changed, 0 insertions, 34 deletions
diff --git a/tests/test_util.py b/tests/test_util.py
index 1c276f8d..ec03846b 100644
--- a/tests/test_util.py
+++ b/tests/test_util.py
@@ -21,7 +21,6 @@ Some unit tests for utility functions.
"""
from binascii import hexlify
-import errno
import os
from hashlib import sha1
import unittest
@@ -108,39 +107,6 @@ class UtilTest(unittest.TestCase):
finally:
os.unlink("hostfile.temp")
- def test_eintr_retry(self):
- assert "foo" == paramiko.util.retry_on_signal(lambda: "foo")
-
- # Variables that are set by raises_intr
- intr_errors_remaining = [3]
- call_count = [0]
-
- def raises_intr():
- call_count[0] += 1
- if intr_errors_remaining[0] > 0:
- intr_errors_remaining[0] -= 1
- raise IOError(errno.EINTR, "file", "interrupted system call")
-
- self.assertTrue(paramiko.util.retry_on_signal(raises_intr) is None)
- assert 0 == intr_errors_remaining[0]
- assert 4 == call_count[0]
-
- def raises_ioerror_not_eintr():
- raise IOError(errno.ENOENT, "file", "file not found")
-
- self.assertRaises(
- IOError,
- lambda: paramiko.util.retry_on_signal(raises_ioerror_not_eintr),
- )
-
- def raises_other_exception():
- raise AssertionError("foo")
-
- self.assertRaises(
- AssertionError,
- lambda: paramiko.util.retry_on_signal(raises_other_exception),
- )
-
def test_clamp_value(self):
assert 32768 == paramiko.util.clamp_value(32767, 32768, 32769)
assert 32767 == paramiko.util.clamp_value(32767, 32765, 32769)