4 ms·
To give the individual tests import context, create a tests/context.py file: import os import sys sys.path.insert(0, os.path.abspath(os.path.join(os.path
by bvrmn 7y ago
To give the individual tests import context, create a tests/context.py file:
import os
import sys
sys.path.insert(0, os.path.abspath(os.path.join(os.path.dirname(__file__), '..')))
Or you can convert your tests directory to package by placing __init__.py. It's pretty amazing that Kenneth Reitz uses this ugly solution.