diff --git a/tests/test_bugs.py b/tests/test_bugs.py index 2103b98..6ffeb22 100644 --- a/tests/test_bugs.py +++ b/tests/test_bugs.py @@ -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 @@ -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 diff --git a/tests/test_readline.py b/tests/test_readline.py index 10a200a..0992f2f 100644 --- a/tests/test_readline.py +++ b/tests/test_readline.py @@ -1,4 +1,5 @@ import os +import sys import pty import pytest @@ -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) @@ -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) @@ -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", [