Skip to content

Commit 3c587d8

Browse files
author
Leigh Gordon
committed
Replacing deprecated setup.py test entry point with pytest
1 parent f861e1f commit 3c587d8

4 files changed

Lines changed: 18 additions & 4 deletions

File tree

.travis.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,12 @@ python:
44
- "3.6"
55

66
install:
7-
- pip install -r requirements.txt
8-
- pip install coverage
7+
- pip install -r test_requirements.txt
8+
- pip install pytest-cov
99
- pip install codecov
1010

1111
script:
12-
- coverage run setup.py test
12+
- pytest --cov=./
1313

1414
after_success:
1515
- codecov

Jenkinsfile

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,8 @@ pipeline {
3434
}
3535
stage('test') {
3636
steps {
37-
sh 'python setup.py test'
37+
sh 'pip install --user -r test_requirements.txt'
38+
sh 'pytest'
3839
}
3940
}
4041
stage('package') {

setup.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,14 @@
88
'xarray>=0.11.3,<0.14.0'
99
]
1010

11+
TESTS_REQUIRE = [
12+
'pytest'
13+
]
14+
15+
EXTRAS_REQUIRE = {
16+
'testing': TESTS_REQUIRE
17+
}
18+
1119
PACKAGE_DATA = {
1220
'aodntools.ncwriter': ['*.json'],
1321
'aodntools.timeseries_products': ['*.json']
@@ -29,6 +37,8 @@
2937
zip_safe=False,
3038
python_requires='>=3.5',
3139
install_requires=INSTALL_REQUIRES,
40+
tests_require=TESTS_REQUIRE,
41+
extras_require=EXTRAS_REQUIRE,
3242
test_suite='test_aodntools',
3343
classifiers=[
3444
'Development Status :: 5 - Production/Stable',

test_requirements.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
--index-url https://pypi.python.org/simple/
2+
-r requirements.txt
3+
-e .[testing]

0 commit comments

Comments
 (0)