1717# CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
1818# CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
1919
20- import sys
21-
2220from pyrepl .historical_reader import HistoricalReader
23- from .infrastructure import EA , TestReader , read_spec
21+ from .infrastructure import EA , BaseTestReader , sane_term , read_spec
2422
2523# this test case should contain as-verbatim-as-possible versions of
2624# (applicable) bug reports
2725
2826import pytest
2927
3028
31- class HistoricalTestReader (HistoricalReader , TestReader ):
29+ class HistoricalTestReader (HistoricalReader , BaseTestReader ):
3230 pass
3331
3432
@@ -48,7 +46,8 @@ def test_cmd_instantiation_crash():
4846 read_spec (spec , HistoricalTestReader )
4947
5048
51- @pytest .mark .skipif (sys .platform == "osx" , reason = "hangs on osx" )
49+ @pytest .mark .skipif ("os.name != 'posix' or 'darwin' in sys.platform or "
50+ "'kfreebsd' in sys.platform" )
5251def test_signal_failure (monkeypatch ):
5352 import os
5453 import pty
@@ -63,13 +62,14 @@ def really_failing_signal(a, b):
6362
6463 mfd , sfd = pty .openpty ()
6564 try :
66- c = UnixConsole (sfd , sfd )
67- c .prepare ()
68- c .restore ()
69- monkeypatch .setattr (signal , 'signal' , failing_signal )
70- c .prepare ()
71- monkeypatch .setattr (signal , 'signal' , really_failing_signal )
72- c .restore ()
65+ with sane_term ():
66+ c = UnixConsole (sfd , sfd )
67+ c .prepare ()
68+ c .restore ()
69+ monkeypatch .setattr (signal , 'signal' , failing_signal )
70+ c .prepare ()
71+ monkeypatch .setattr (signal , 'signal' , really_failing_signal )
72+ c .restore ()
7373 finally :
7474 os .close (mfd )
7575 os .close (sfd )
0 commit comments