parent
f7fda52fd0
commit
3400faa1d2
6 changed files with 56 additions and 4 deletions
0
core/integration_tests/__init__.py
Normal file
0
core/integration_tests/__init__.py
Normal file
33
core/integration_tests/main.py
Normal file
33
core/integration_tests/main.py
Normal file
|
@ -0,0 +1,33 @@
|
|||
import time
|
||||
import os
|
||||
import signal
|
||||
|
||||
import sys
|
||||
from os import path
|
||||
sys.path.append( path.dirname( path.dirname( path.abspath(__file__) ) ) )
|
||||
|
||||
def run():
|
||||
while True:
|
||||
newpid = os.fork()
|
||||
if newpid == 0:
|
||||
import coverage
|
||||
cov = coverage.Coverage()
|
||||
cov.load()
|
||||
cov.start()
|
||||
signal.signal(signal.SIGINT, signal.default_int_handler)
|
||||
try:
|
||||
from server import main
|
||||
main()
|
||||
except KeyboardInterrupt:
|
||||
pass
|
||||
cov.stop()
|
||||
cov.save()
|
||||
os._exit(0)
|
||||
else:
|
||||
return newpid
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
pid = run()
|
||||
time.sleep(5)
|
||||
os.kill(pid, signal.SIGINT)
|
Loading…
Add table
Add a link
Reference in a new issue