Use this version of `pytest`, which is guaranteed to be available because it's bundled in Astropy:
```
from astropy.tests.helper import pytest
```