astropy/astropy — pull request #22 by jiffyclub (2011-10-16 21:16:28+00:00)
Title: Test helper

I modified tests/helper.py so that it automatically loads the pytest module from the script in extern/pytest.py in the event that it can't import pytest directly.

When developers are writing tests they can import pytest like so (they'll have to get the relative part right for their module):

from ..tests.helper import pytest

This will give them an installed pytest if it exists, or extern/pytest otherwise.

This change also allowed me to remove the pytest.main function wrapper from helper.py. Now the best thing to do is directly call pytest.main after importing pytest from test.helper.