<s> from __future__ import with_statement <EOL> import os <EOL> import signal <EOL> import sys <EOL> import nose <EOL> from nose . tools import assert_raises <EOL> from warnings import catch_warnings <EOL> from . . util import ignore_sigint <EOL> from . import PyfitsTestCase <EOL> class TestUtils ( PyfitsTestCase ) : <EOL> def test_ignore_sigint ( self ) : <EOL> if sys . platform . startswith ( '<STR_LIT>' ) : <EOL> raise nose . SkipTest ( '<STR_LIT>' ) <EOL> @ ignore_sigint <EOL> def test ( ) : <EOL> with catch_warnings ( record = True ) as w : <EOL> pid = os . getpid ( ) <EOL> os . kill ( pid , signal . SIGINT ) <EOL> os . kill ( pid , signal . SIGINT ) <EOL> assert len ( w ) == <NUM_LIT:2> <EOL> assert ( str ( w [ <NUM_LIT:0> ] . message ) == <EOL> '<STR_LIT>' <EOL> '<STR_LIT>' ) <EOL> assert_raises ( KeyboardInterrupt , test ) </s>
