summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJeff Quast <jquast@io.com>2015-02-22 12:38:32 -0800
committerJeff Quast <jquast@io.com>2015-02-22 13:07:07 -0800
commit37223bf57518dd3c9a16eb65f7f78c7e1f88ead5 (patch)
tree3699f1d8ccf3b722a66a12e2990ff2258703df99
parentabe0df1c5285a9cddf528db74a432f14b0954dae (diff)
downloadpexpect-git-37223bf57518dd3c9a16eb65f7f78c7e1f88ead5.tar.gz
FreeBSD: Necessary to skip test_beyond_max_icanon
sendline('_' * send_bytes) causes os.write to BLOCK indefinitely
-rw-r--r--tests/test_maxcanon.py20
1 files changed, 18 insertions, 2 deletions
diff --git a/tests/test_maxcanon.py b/tests/test_maxcanon.py
index 95f9025..3d3f558 100644
--- a/tests/test_maxcanon.py
+++ b/tests/test_maxcanon.py
@@ -1,11 +1,15 @@
""" Module for canonical-mode tests. """
+# std imports
import sys
import os
-
+# local
import pexpect
from . import PexpectTestCase
+# 3rd-party
+import pytest
+
class TestCaseCanon(PexpectTestCase.PexpectTestCase):
"""
@@ -55,6 +59,10 @@ class TestCaseCanon(PexpectTestCase.PexpectTestCase):
# All others (probably) limit exactly at PC_MAX_CANON
self.max_input = os.fpathconf(0, 'PC_MAX_CANON')
+ @pytest.mark.skipif(
+ sys.platform.lower().startswith('freebsd'),
+ reason='os.write to BLOCK indefinitely on FreeBSD in this case'
+ )
def test_under_max_canon(self):
" BEL is not sent by terminal driver at maximum bytes - 1. "
# given,
@@ -89,6 +97,10 @@ class TestCaseCanon(PexpectTestCase.PexpectTestCase):
assert not child.isalive()
assert child.exitstatus == 0
+ @pytest.mark.skipif(
+ sys.platform.lower().startswith('freebsd'),
+ reason='os.write to BLOCK indefinitely on FreeBSD in this case'
+ )
def test_beyond_max_icanon(self):
" a single BEL is sent when maximum bytes is reached. "
# given,
@@ -98,7 +110,7 @@ class TestCaseCanon(PexpectTestCase.PexpectTestCase):
send_bytes = self.max_input
# exercise,
- child.send('_' * send_bytes)
+ child.sendline('_' * send_bytes)
child.expect_exact('\a')
# exercise, we must now backspace to send CR.
@@ -124,6 +136,10 @@ class TestCaseCanon(PexpectTestCase.PexpectTestCase):
assert not child.isalive()
assert child.exitstatus == 0
+ @pytest.mark.skipif(
+ sys.platform.lower().startswith('freebsd'),
+ reason='os.write to BLOCK indefinitely on FreeBSD in this case'
+ )
def test_max_no_icanon(self):
" may exceed maximum input bytes if canonical mode is disabled. "
# given,