mdipierro/web2py — pull request #21 by msabramo (2012-05-04 14:36:26+00:00)
Title: Change relative imports to absolute imports in tests

to prevent various exceptions when trying to run

`python -m unittest discover` from the web2py root directory.

Without these changes, I get:

```
marc@hyperion:~/dev/git-repos/web2py
07:32:46 $ python -m unittest discover
EEE.......................................................................................................................
======================================================================
ERROR: gluon.contrib.pymysql.tests.test_basic (unittest.loader.ModuleImportFailure)
----------------------------------------------------------------------
ImportError: Failed to import test module: gluon.contrib.pymysql.tests.test_basic
Traceback (most recent call last):
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/unittest/loader.py", line 252, in _find_tests
module = self._get_module_from_name(name)
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/unittest/loader.py", line 230, in _get_module_from_name
__import__(name)
File "/Users/marc/dev/git-repos/web2py/gluon/contrib/pymysql/tests/__init__.py", line 1, in
from pymysql.tests.test_issues import *
File "/Users/marc/dev/git-repos/web2py/web2py.venv/lib/python2.7/site-packages/pymysql/tests/__init__.py", line 9, in
from pymysql.tests.thirdparty import *
ImportError: No module named thirdparty

======================================================================
ERROR: gluon.contrib.pymysql.tests.test_example (unittest.loader.ModuleImportFailure)
----------------------------------------------------------------------
ImportError: Failed to import test module: gluon.contrib.pymysql.tests.test_example
Traceback (most recent call last):
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/unittest/loader.py", line 252, in _find_tests
module = self._get_module_from_name(name)
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/unittest/loader.py", line 230, in _get_module_from_name
__import__(name)
File "/Users/marc/dev/git-repos/web2py/gluon/contrib/pymysql/tests/__init__.py", line 1, in
from pymysql.tests.test_issues import *
File "/Users/marc/dev/git-repos/web2py/web2py.venv/lib/python2.7/site-packages/pymysql/tests/__init__.py", line 9, in
from pymysql.tests.thirdparty import *
ImportError: No module named thirdparty

======================================================================
ERROR: gluon.contrib.pymysql.tests.test_issues (unittest.loader.ModuleImportFailure)
----------------------------------------------------------------------
ImportError: Failed to import test module: gluon.contrib.pymysql.tests.test_issues
Traceback (most recent call last):
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/unittest/loader.py", line 252, in _find_tests
module = self._get_module_from_name(name)
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/unittest/loader.py", line 230, in _get_module_from_name
__import__(name)
File "/Users/marc/dev/git-repos/web2py/gluon/contrib/pymysql/tests/__init__.py", line 1, in
from pymysql.tests.test_issues import *
File "/Users/marc/dev/git-repos/web2py/web2py.venv/lib/python2.7/site-packages/pymysql/tests/__init__.py", line 9, in
from pymysql.tests.thirdparty import *
ImportError: No module named thirdparty

----------------------------------------------------------------------
Ran 122 tests in 3.707s

FAILED (errors=3)
```