Add all test requirements to setup.py. Use setup.py test on travis.
Install fastimport, mock and gevent from the apt repository so they don't have to be downloaded.
Use with statement rather than try: finaly: x.close().