-
-
Notifications
You must be signed in to change notification settings - Fork 128
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
10 changed files
with
129 additions
and
100 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,25 +1,26 @@ | ||
Copyright (c) 2020, Specutils Developers | ||
All rights reserved. | ||
Copyright 2020 Specutils Developers | ||
|
||
Redistribution and use in source and binary forms, with or without modification, | ||
are permitted provided that the following conditions are met: | ||
Redistribution and use in source and binary forms, with or without | ||
modification, are permitted provided that the following conditions are met: | ||
|
||
* Redistributions of source code must retain the above copyright notice, this | ||
list of conditions and the following disclaimer. | ||
* Redistributions in binary form must reproduce the above copyright notice, this | ||
list of conditions and the following disclaimer in the documentation and/or | ||
other materials provided with the distribution. | ||
* Neither the name of the Astropy Team nor the names of its contributors may be | ||
used to endorse or promote products derived from this software without | ||
specific prior written permission. | ||
1. Redistributions of source code must retain the above copyright notice, this | ||
list of conditions and the following disclaimer. | ||
|
||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND | ||
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED | ||
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE | ||
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR | ||
ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES | ||
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; | ||
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON | ||
ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | ||
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS | ||
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | ||
2. Redistributions in binary form must reproduce the above copyright notice, | ||
this list of conditions and the following disclaimer in the documentation | ||
and/or other materials provided with the distribution. | ||
|
||
3. Neither the name of the copyright holder nor the names of its | ||
contributors may be used to endorse or promote products derived from | ||
this software without specific prior written permission. | ||
|
||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" | ||
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE | ||
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE | ||
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE | ||
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL | ||
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR | ||
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER | ||
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, | ||
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | ||
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,57 +1,55 @@ | ||
# this contains imports plugins that configure py.test for astropy tests. | ||
# by importing them here in conftest.py they are discoverable by py.test | ||
# no matter how it is invoked within the source tree. | ||
# This file is used to configure the behavior of pytest when using the Astropy | ||
# test infrastructure. It needs to live inside the package in order for it to | ||
# get picked up when running the tests inside an interpreter using | ||
# packagename.test | ||
|
||
from importlib.util import find_spec | ||
import os | ||
|
||
from astropy.version import version as astropy_version | ||
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 | ||
enable_deprecations_as_exceptions() | ||
|
||
# Uncomment and customize the following lines to add/remove entries from | ||
# the list of packages for which version numbers are displayed when running | ||
# the tests. Making it pass for KeyError is essential in some cases when | ||
# the package uses other astropy affiliated packages. | ||
try: | ||
PYTEST_HEADER_MODULES['Astropy'] = 'astropy' | ||
PYTEST_HEADER_MODULES['gwcs'] = 'gwcs' | ||
del PYTEST_HEADER_MODULES['h5py'] | ||
del PYTEST_HEADER_MODULES['Pandas'] | ||
del PYTEST_HEADER_MODULES['Matplotlib'] | ||
except (NameError, KeyError): # NameError is needed to support Astropy < 1.0 | ||
pass | ||
|
||
# Use ASDF schema tester plugin if ASDF is installed | ||
if find_spec('asdf') is not None: | ||
PYTEST_HEADER_MODULES['Asdf'] = 'asdf' | ||
|
||
# Uncomment the following lines to display the version number of the | ||
# package rather than the version number of Astropy in the top line when | ||
# running the tests. | ||
import os | ||
|
||
# This is to figure out the affiliated package version, rather than | ||
# using Astropy's | ||
try: | ||
from .version import version | ||
except ImportError: | ||
version = 'dev' | ||
|
||
try: | ||
packagename = os.path.basename(os.path.dirname(__file__)) | ||
TESTED_VERSIONS[packagename] = version | ||
except NameError: # Needed to support Astropy <= 1.0.0 | ||
pass | ||
|
||
|
||
# makes sure matplotlib doesn't try to pop up plots | ||
try: | ||
import matplotlib | ||
except ImportError: | ||
pass | ||
# For Astropy 3.0 and later, we can use the standalone pytest plugin | ||
if astropy_version < '3.0': | ||
from astropy.tests.pytest_plugins import * # noqa | ||
del pytest_report_header | ||
ASTROPY_HEADER = True | ||
else: | ||
matplotlib.use('Agg') | ||
try: | ||
from pytest_astropy_header.display import PYTEST_HEADER_MODULES, TESTED_VERSIONS | ||
ASTROPY_HEADER = True | ||
except ImportError: | ||
ASTROPY_HEADER = False | ||
|
||
|
||
def pytest_configure(config): | ||
|
||
if ASTROPY_HEADER: | ||
|
||
config.option.astropy_header = True | ||
|
||
# Customize the following lines to add/remove entries from the list of | ||
# packages for which version numbers are displayed when running the tests. | ||
PYTEST_HEADER_MODULES.pop('Pandas', None) | ||
PYTEST_HEADER_MODULES['gwcs'] = 'gwcs' | ||
del PYTEST_HEADER_MODULES['h5py'] | ||
del PYTEST_HEADER_MODULES['Matplotlib'] | ||
# Use ASDF schema tester plugin if ASDF is installed | ||
from importlib.util import find_spec | ||
if find_spec('asdf') is not None: | ||
PYTEST_HEADER_MODULES['Asdf'] = 'asdf' | ||
|
||
from . import __version__ | ||
packagename = os.path.basename(os.path.dirname(__file__)) | ||
TESTED_VERSIONS[packagename] = __version__ | ||
|
||
# Uncomment the last two lines in this block to treat all DeprecationWarnings as | ||
# exceptions. For Astropy v2.0 or later, there are 2 additional keywords, | ||
# as follow (although default should work for most cases). | ||
# To ignore some packages that produce deprecation warnings on import | ||
# (in addition to 'compiler', 'scipy', 'pygments', 'ipykernel', and | ||
# 'setuptools'), add: | ||
# modules_to_ignore_on_import=['module_1', 'module_2'] | ||
# To ignore some specific deprecation warning messages for Python version | ||
# MAJOR.MINOR or later, add: | ||
# warnings_to_ignore_by_pyver={(MAJOR, MINOR): ['Message to ignore']} | ||
from astropy.tests.helper import enable_deprecations_as_exceptions # noqa | ||
enable_deprecations_as_exceptions() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters