<s> import signal <EOL> from subprocess import Popen <EOL> import pytest <EOL> @ pytest . mark . parametrize ( '<STR_LIT>' , [ <NUM_LIT:0> , <NUM_LIT:1> , <NUM_LIT:2> , <NUM_LIT:32> , <NUM_LIT:64> , <NUM_LIT> , <NUM_LIT> , <NUM_LIT:255> ] ) <EOL> def test_exit_status_regular_exit ( exit_status , both_debug_modes , both_setsid_modes ) : <EOL> """<STR_LIT>""" <EOL> proc = Popen ( ( '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT:-c>' , '<STR_LIT>' . format ( exit_status ) ) ) <EOL> proc . wait ( ) <EOL> assert proc . returncode == exit_status <EOL> @ pytest . mark . parametrize ( '<STR_LIT>' , [ <EOL> signal . SIGTERM , <EOL> signal . SIGINT , <EOL> signal . SIGQUIT , <EOL> signal . SIGKILL , <EOL> ] ) <EOL> def test_exit_status_terminated_by_signal ( signal , both_debug_modes , both_setsid_modes ) : <EOL> """<STR_LIT>""" <EOL> proc = Popen ( ( '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT:-c>' , '<STR_LIT>' . format ( signal ) ) ) <EOL> proc . wait ( ) <EOL> assert proc . returncode == <NUM_LIT> + signal </s>
