-
Notifications
You must be signed in to change notification settings - Fork 23
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #53 from spacetelescope/testing_setup
This PR adds several updates to stistools. Removes distutils dependency, removes Python 2 support, pep 8 fixes, and adds artifactory unit tests.
- Loading branch information
Showing
50 changed files
with
2,166 additions
and
1,232 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
RELIC-INFO | ||
relic/ | ||
*/version.py | ||
build/ | ||
dist/ | ||
*.pyc | ||
*.o | ||
*.so | ||
*.egg-info | ||
*.swp |
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 |
---|---|---|
@@ -0,0 +1,22 @@ | ||
if (utils.scm_checkout()) return | ||
|
||
|
||
data_config = new DataConfig() | ||
data_config.server_id = "bytesalad" | ||
data_config.root = 'tests_output' | ||
data_config.match_prefix = '(.*)_result' // .json is appended automatically | ||
|
||
|
||
bc0 = new BuildConfig() | ||
bc0.nodetype = "linux" | ||
bc0.name = "Install" | ||
bc0.test_configs = [data_config] | ||
bc0.build_cmds = ["conda env update --file=doc/environment.yml -q", | ||
"with_env -n stistools python setup.py install", | ||
"with_env -n stistools conda install -q -y -c http://ssb.stsci.edu/astroconda hstcal", | ||
"with_env -n stistools conda install -q -y -c http://ssb.stsci.edu/astroconda crds"] | ||
bc0.test_cmds = ["with_env -n stistools conda install -q -y pytest", | ||
"with_env -n stistools conda install -q -y pytest-remotedata", | ||
"with_env -n stistools pytest --basetemp=tests_output --junitxml results.xml --bigdata"] | ||
|
||
utils.run([bc0]) |
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 |
---|---|---|
@@ -0,0 +1,4 @@ | ||
include RELIC-INFO | ||
exclude stistools/version.py | ||
recursive-include stistools/pars *.cfg* | ||
|
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 |
---|---|---|
@@ -0,0 +1,50 @@ | ||
"""Project default for pytest""" | ||
import os | ||
import pytest | ||
|
||
from astropy.tests.plugins.display import PYTEST_HEADER_MODULES | ||
from astropy.tests.helper import enable_deprecations_as_exceptions | ||
|
||
|
||
# Uncomment the following line to treat all DeprecationWarnings as exceptions | ||
enable_deprecations_as_exceptions() | ||
|
||
def pytest_addoption(parser): | ||
# Add option to run slow tests | ||
parser.addoption( | ||
"--runslow", | ||
action="store_true", | ||
help="run slow tests" | ||
) | ||
|
||
parser.addoption( | ||
"--slow", | ||
action="store_true", | ||
help="run slow tests" | ||
) | ||
|
||
# Add option to use big data sets | ||
parser.addoption( | ||
"--bigdata", | ||
action="store_true", | ||
help="use big data sets (intranet)" | ||
) | ||
|
||
parser.addoption( | ||
"--env", | ||
choices=['dev', 'stable', ''], | ||
default='', | ||
help="specify what environment to test" | ||
) | ||
|
||
|
||
@pytest.fixture(scope='function', autouse=True) | ||
def _jail(tmpdir): | ||
""" Perform test in a pristine temporary working directory | ||
""" | ||
os.chdir(tmpdir.strpath) | ||
yield | ||
|
||
@pytest.fixture | ||
def envopt(request): | ||
return request.config.getoption("env") |
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.