Skip to content

Commit

Permalink
Merge pull request #80 from astrofrog/test-requirements
Browse files Browse the repository at this point in the history
Check that pytest-arraydiff is installed
  • Loading branch information
cdeil committed Nov 28, 2016
2 parents 9682cd9 + d12176e commit 9939e79
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 0 deletions.
12 changes: 12 additions & 0 deletions docs/installation.rst
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,19 @@ Install the latest development version from https://github.com/astropy/regions :
git clone https://github.com/astropy/regions
cd regions
python setup.py install
To run the tests, you will need to make sure the `pytest-arraydiff
<https://pypi.python.org/pypi/pytest-arraydiff>`_ package is installed. Then,
run the tests with:

.. code-block:: bash
python setup.py test
To build the documentation, do:

.. code-block:: bash
python setup.py build_docs
Optional dependencies
Expand Down
11 changes: 11 additions & 0 deletions regions/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,17 @@
# by importing them here in conftest.py they are discoverable by py.test
# no matter how it is invoked within the source tree.

try:
import pytest_arraydiff
except ImportError:
raise ImportError("The pytest-arraydiff package is required for the tests. "
"You can install it with: pip install pytest-arraydiff")
else:
# We need to remove pytest_arraydiff from the namespace otherwise pytest
# gets confused, because it tries to interpret pytest_* as a special
# function name.
del pytest_arraydiff

from astropy.tests.pytest_plugins import *

## Uncomment the following line to treat all DeprecationWarnings as
Expand Down
1 change: 1 addition & 0 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,7 @@
],
test=[
'pytest-mpl',
'pytest-arraydiff'
],
),
author=AUTHOR,
Expand Down

0 comments on commit 9939e79

Please sign in to comment.