from subprocess import call
from sniffer.api import runnable


@runnable
def execute_tests(*args):
    fn = ['python', 'manage.py', 'test', '--noinput', '--settings=testsettings']
    fn += args[1:]
    return call(fn) == 0

from subprocess import Popen
from sniffer.api import runnable


@runnable
def execute_tests(*args):
    fn = ['python', 'manage.py', 'test', '--noinput', '--settings=testsettings']
    fn += args[1:]
    process = Popen(fn)
    try:
        return process.wait() == 0
    except KeyboardInterrupt:
        process.terminate()
        raise

Kill Nose when ^C in sniffer
Kill Nose when ^C in sniffer

- from subprocess import call
+ from subprocess import Popen
  from sniffer.api import runnable
  
  
  @runnable
  def execute_tests(*args):
      fn = ['python', 'manage.py', 'test', '--noinput', '--settings=testsettings']
      fn += args[1:]
-     return call(fn) == 0
+     process = Popen(fn)
+     try:
+         return process.wait() == 0
+     except KeyboardInterrupt:
+         process.terminate()
+         raise
  
Kill Nose when ^C in sniffer
## Code Before:
from subprocess import call
from sniffer.api import runnable


@runnable
def execute_tests(*args):
    fn = ['python', 'manage.py', 'test', '--noinput', '--settings=testsettings']
    fn += args[1:]
    return call(fn) == 0

## Instruction:
Kill Nose when ^C in sniffer
## Code After:
from subprocess import Popen
from sniffer.api import runnable


@runnable
def execute_tests(*args):
    fn = ['python', 'manage.py', 'test', '--noinput', '--settings=testsettings']
    fn += args[1:]
    process = Popen(fn)
    try:
        return process.wait() == 0
    except KeyboardInterrupt:
        process.terminate()
        raise
