fixed tests to run properly when called from tests.py