Skip to content
Snippets Groups Projects
Commit af373ea9 authored by Piotr Maślanka's avatar Piotr Maślanka
Browse files

test hang_until_sig

parent 0e803194
No related branches found
No related tags found
No related merge requests found
...@@ -24,7 +24,6 @@ Syntactic sugar for `int(time.time()*1000)` ...@@ -24,7 +24,6 @@ Syntactic sugar for `int(time.time()*1000)`
.. autofunction:: satella.time.time_ms .. autofunction:: satella.time.time_ms
time_us time_us
---------- ----------
Syntactic sugar for `int(time.time()*1000000)` Syntactic sugar for `int(time.time()*1000000)`
......
...@@ -4,18 +4,21 @@ import sys ...@@ -4,18 +4,21 @@ import sys
import threading import threading
import unittest import unittest
import time import time
import multiprocessing
from satella.os import hang_until_sig from satella.os import hang_until_sig
class TestHangUntilSig(unittest.TestCase): class TestHangUntilSig(unittest.TestCase):
@unittest.skipIf('win' in sys.platform, 'Cannot test on Windows')
def test_hang_until_sig(self): def test_hang_until_sig(self):
def send_sig(): def child_process():
time.sleep(1) hang_until_sig()
os.kill(0, signal.SIGTERM)
threading.Thread(target=send_sig).start() mp = multiprocessing.Process(target=child_process)
hang_until_sig() mp.start()
os.kill(mp.pid, signal.SIGTERM)
time.sleep(2)
os.wait()
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment