Skip to content

Commit

Permalink
tests: broken test skip hanging tests on macos
Browse files Browse the repository at this point in the history
On MacOS, `termiois.tcdrain` and `termios.tcsetattr(tty_fd, termios.TCSADRAIN, attrs)` hang up until 3.9.8.

See python/cpython#97001
  • Loading branch information
bretello committed May 3, 2024
1 parent fe9a964 commit 04d429c
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 0 deletions.
6 changes: 6 additions & 0 deletions tests/test_bugs.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@
# CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
# CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.

import sys

import pytest

from pyrepl.historical_reader import HistoricalReader
Expand Down Expand Up @@ -45,6 +47,10 @@ def test_cmd_instantiation_crash():
read_spec(spec, HistoricalTestReader)


@pytest.mark.skipif(
sys.platform == "darwin" and sys.version_info < (3, 10, 9),
reason="prepare() hangs due to termios.tcdrain hanging on MacOS https://github.com/python/cpython/issues/97001",
)
def test_signal_failure(monkeypatch):
import os
import pty
Expand Down
13 changes: 13 additions & 0 deletions tests/test_readline.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import os
import pty
import sys

import pytest

Expand All @@ -12,6 +13,10 @@ def readline_wrapper():
return _ReadlineWrapper(slave, slave)


@pytest.mark.skipif(
sys.platform == "darwin" and sys.version_info < (3, 10, 9),
reason="readline() hangs due to termios.tcdrain hanging on MacOS https://github.com/python/cpython/issues/97001",
)
def test_readline():
master, slave = pty.openpty()
readline_wrapper = _ReadlineWrapper(slave, slave)
Expand All @@ -22,6 +27,10 @@ def test_readline():
assert isinstance(result, bytes)


@pytest.mark.skipif(
sys.platform == "darwin" and sys.version_info < (3, 10, 9),
reason="readline() hangs due to termios.tcdrain hanging on MacOS https://github.com/python/cpython/issues/97001",
)
def test_input():
master, slave = pty.openpty()
readline_wrapper = _ReadlineWrapper(slave, slave)
Expand All @@ -32,6 +41,10 @@ def test_input():
assert isinstance(result, str)


@pytest.mark.skipif(
sys.platform == "darwin" and sys.version_info < (3, 10, 9),
reason="readline() hangs due to termios.tcdrain hanging on MacOS https://github.com/python/cpython/issues/97001",
)
@pytest.mark.parametrize(
"get_bytes,expected",
[
Expand Down

0 comments on commit 04d429c

Please sign in to comment.