Skip to content

Commit

Permalink
Merge f834306 into 80a06bc
Browse files Browse the repository at this point in the history
  • Loading branch information
bsipocz committed Feb 22, 2019
2 parents 80a06bc + f834306 commit 4a06deb
Show file tree
Hide file tree
Showing 3 changed files with 31 additions and 9 deletions.
1 change: 1 addition & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@ matrix:
NUMPY_VERSION=1.11
- env: PYTHON_VERSION=3.5
NUMPY_VERSION=1.10
ASTROPY_VERSION=3.0

# Try numpy pre-release
- env: NUMPY_VERSION=prerelease
Expand Down
4 changes: 2 additions & 2 deletions docs/installation.rst
Original file line number Diff line number Diff line change
Expand Up @@ -66,8 +66,8 @@ Install the latest development version from https://github.com/astropy/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:
<https://pypi.python.org/pypi/pytest-arraydiff>`_ package is installed
(version v0.3 or newer). Then, run the tests with:

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

from distutils.version import LooseVersion

try:
import pytest_arraydiff
except ImportError:
Expand All @@ -13,7 +15,28 @@
# function name.
del pytest_arraydiff

from astropy.tests.pytest_plugins import * # noqa

from astropy.version import version as astropy_version

if LooseVersion(astropy_version) < LooseVersion('2.0.3'):
# Astropy is not compatible with the standalone plugins prior this while
# astroquery requires them, so we need this workaround. This will mess
# up the test header, but everything else will work.
from astropy.tests.pytest_plugins import (PYTEST_HEADER_MODULES,
TESTED_VERSIONS)
elif astropy_version < '3.0':
# With older versions of Astropy, we actually need to import the pytest
# plugins themselves in order to make them discoverable by pytest.
from astropy.tests.pytest_plugins import *
else:
# As of Astropy 3.0, the pytest plugins provided by Astropy are
# automatically made available when Astropy is installed. This means it's
# not necessary to import them here, but we still need to import global
# variables that are used for configuration.
from astropy.tests.plugins.display import PYTEST_HEADER_MODULES, TESTED_VERSIONS

from astropy.tests.helper import enable_deprecations_as_exceptions


# Uncomment the following line to treat all DeprecationWarnings as
# exceptions
Expand All @@ -40,12 +63,10 @@
# This is to figure out the affiliated package version, rather than
# using Astropy's
try:
from .version import version
from .version import version, astropy_helpers_version
except ImportError:
version = 'dev'

try:
packagename = os.path.basename(os.path.dirname(__file__))
TESTED_VERSIONS[packagename] = version # noqa
except NameError: # Needed to support Astropy <= 1.0.0
pass
packagename = os.path.basename(os.path.dirname(__file__))
TESTED_VERSIONS[packagename] = version # noqa
TESTED_VERSIONS['astropy_helpers'] = astropy_helpers_version

0 comments on commit 4a06deb

Please sign in to comment.