17
17
# CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
18
18
# CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
19
19
20
- import sys
21
-
22
20
from pyrepl .historical_reader import HistoricalReader
23
- from .infrastructure import EA , TestReader , read_spec
21
+ from .infrastructure import EA , BaseTestReader , sane_term , read_spec
24
22
25
23
# this test case should contain as-verbatim-as-possible versions of
26
24
# (applicable) bug reports
27
25
28
26
import pytest
29
27
30
28
31
- class HistoricalTestReader (HistoricalReader , TestReader ):
29
+ class HistoricalTestReader (HistoricalReader , BaseTestReader ):
32
30
pass
33
31
34
32
@@ -48,7 +46,8 @@ def test_cmd_instantiation_crash():
48
46
read_spec (spec , HistoricalTestReader )
49
47
50
48
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" )
52
51
def test_signal_failure (monkeypatch ):
53
52
import os
54
53
import pty
@@ -63,13 +62,14 @@ def really_failing_signal(a, b):
63
62
64
63
mfd , sfd = pty .openpty ()
65
64
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 ()
73
73
finally :
74
74
os .close (mfd )
75
75
os .close (sfd )
0 commit comments