Source

gevent-gtkloop / runtests.py

#!/usr/bin/python
import os
from os.path import dirname, abspath, join as pjoin
import sys
import subprocess
import gevent
gevent_base = abspath(dirname(dirname(gevent.__file__)))
testdir = pjoin(gevent_base, 'greentest')
testrunner = pjoin(testdir, 'testrunner.py')

loopdir = abspath(dirname(__file__))

pythonpath = os.environ.get('PYTHONPATH', '')
if pythonpath:
    pythonpath += ':' + loopdir
else:
    pythonpath = loopdir

os.chdir(testdir)
env = dict(os.environ,
    PYTHONPATH=pythonpath,
    GEVENT_LOOP='gtkloop.GtkLoop',
    GEVENT_RESOLVER='gevent.resolver_thread.Resolver',
)

os.execve(sys.executable,
          [sys.executable, testrunner] + sys.argv[1:],
          env)