I have 2 modules a.py and b.py inside applications/app/tests directory and am trying to import b.py from a.py. I find it not easy as I am calling a.py using web2py shell, which disallows the usage of __file__ (otherwise I could append the tests directory to sys.path).
python web2py.py -S app -R applications/app/tests/a.py