Commit 6b139a64 authored by Denis Bilenko's avatar Denis Bilenko

test__examples.py: use mysubprocess

parent 4c58cc6f
...@@ -3,13 +3,13 @@ import os ...@@ -3,13 +3,13 @@ import os
import glob import glob
from os.path import join, abspath, dirname, normpath, basename from os.path import join, abspath, dirname, normpath, basename
import unittest import unittest
import subprocess
import urllib2 import urllib2
import time import time
import signal import signal
import re import re
import gevent import gevent
from gevent import socket from gevent import socket
import mysubprocess as subprocess
# Ignore tracebacks: KeyboardInterrupt # Ignore tracebacks: KeyboardInterrupt
...@@ -61,15 +61,8 @@ class BaseTestServer(unittest.TestCase): ...@@ -61,15 +61,8 @@ class BaseTestServer(unittest.TestCase):
def tearDown(self): def tearDown(self):
self.assertEqual(self.process.poll(), None) self.assertEqual(self.process.poll(), None)
try: self.process.interrupt()
SIGINT = getattr(signal, 'SIGINT', None) time.sleep(0.5)
if SIGINT is not None:
os.kill(self.process.pid, SIGINT)
time.sleep(0.1)
self.assertEqual(self.process.poll(), 1)
finally:
if self.process.poll() is None:
self.process.kill()
class Test_httpserver(BaseTestServer): class Test_httpserver(BaseTestServer):
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment