I'm using the next function to access to the source from tests without
install it (python setup.py develop). It's very usefull during
development so it could be added to py.
------------------------
import os
import sys
def import_local(parent='test', child='lib'):
"""Inserts local library on 'sys.path'.
Goes up until the root of the project (upper of 'parent' directory)
and inserts the 'child' directory.
"""
parent_path = os.path.abspath(os.path.dirname(__file__))
while parent in os.path.basename(parent_path):
parent_path = os.path.dirname(parent_path)
sys.path.insert(0, os.path.join(parent_path, child))
------------------------
_______________________________________________
py-dev mailing list
[email protected]
http://codespeak.net/mailman/listinfo/py-dev