Skip to content

Commit bacebc3

Browse files
committed
TST/CI: Use pytest
update ci DOC Fixup runners
1 parent 51a774d commit bacebc3

19 files changed

+79
-42
lines changed

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,8 @@ dist
5555
**/wheelhouse/*
5656
# coverage
5757
.coverage
58+
coverage.xml
59+
coverage_html_report
5860

5961
# OS generated files #
6062
######################

.travis.yml

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ matrix:
3535
osx_image: xcode6.4
3636
env:
3737
- JOB_NAME: "35_osx"
38-
- NOSE_ARGS="not slow and not network and not disabled"
38+
- NOSE_ARGS="--skip-slow --skip-network"
3939
- BUILD_TYPE=conda
4040
- JOB_TAG=_OSX
4141
- TRAVIS_PYTHON_VERSION=3.5
@@ -44,7 +44,7 @@ matrix:
4444
- python: 2.7
4545
env:
4646
- JOB_NAME: "27_slow_nnet_LOCALE"
47-
- NOSE_ARGS="slow and not network and not disabled"
47+
- NOSE_ARGS="--skip-network"
4848
- LOCALE_OVERRIDE="zh_CN.UTF-8"
4949
- FULL_DEPS=true
5050
- JOB_TAG=_LOCALE
@@ -57,7 +57,7 @@ matrix:
5757
- python: 2.7
5858
env:
5959
- JOB_NAME: "27_nslow"
60-
- NOSE_ARGS="not slow and not disabled"
60+
- NOSE_ARGS="--skip-slow"
6161
- FULL_DEPS=true
6262
- CLIPBOARD_GUI=gtk2
6363
- LINT=true
@@ -70,7 +70,7 @@ matrix:
7070
- python: 3.4
7171
env:
7272
- JOB_NAME: "34_nslow"
73-
- NOSE_ARGS="not slow and not disabled"
73+
- NOSE_ARGS="--skip-slow"
7474
- FULL_DEPS=true
7575
- CLIPBOARD=xsel
7676
- CACHE_NAME="34_nslow"
@@ -82,7 +82,7 @@ matrix:
8282
- python: 3.5
8383
env:
8484
- JOB_NAME: "35_nslow"
85-
- NOSE_ARGS="not slow and not network and not disabled"
85+
- NOSE_ARGS="--skip-slow --skip-network"
8686
- FULL_DEPS=true
8787
- CLIPBOARD=xsel
8888
- COVERAGE=true
@@ -97,7 +97,7 @@ matrix:
9797
env:
9898
- JOB_NAME: "27_slow"
9999
- JOB_TAG=_SLOW
100-
- NOSE_ARGS="slow and not network and not disabled"
100+
- NOSE_ARGS="--skip-network"
101101
- FULL_DEPS=true
102102
- CACHE_NAME="27_slow"
103103
- USE_CACHE=true
@@ -106,7 +106,7 @@ matrix:
106106
env:
107107
- JOB_NAME: "34_slow"
108108
- JOB_TAG=_SLOW
109-
- NOSE_ARGS="slow and not network and not disabled"
109+
- NOSE_ARGS="--skip-network"
110110
- FULL_DEPS=true
111111
- CLIPBOARD=xsel
112112
- CACHE_NAME="34_slow"
@@ -120,7 +120,7 @@ matrix:
120120
env:
121121
- JOB_NAME: "27_build_test_conda"
122122
- JOB_TAG=_BUILD_TEST
123-
- NOSE_ARGS="not slow and not disabled"
123+
- NOSE_ARGS="--skip-slow"
124124
- FULL_DEPS=true
125125
- BUILD_TEST=true
126126
- CACHE_NAME="27_build_test_conda"
@@ -130,7 +130,7 @@ matrix:
130130
env:
131131
- JOB_NAME: "35_numpy_dev"
132132
- JOB_TAG=_NUMPY_DEV
133-
- NOSE_ARGS="not slow and not network and not disabled"
133+
- NOSE_ARGS="--skip-slow --skip-network"
134134
- PANDAS_TESTING_MODE="deprecate"
135135
- CACHE_NAME="35_numpy_dev"
136136
- USE_CACHE=true
@@ -143,7 +143,7 @@ matrix:
143143
- python: 2.7
144144
env:
145145
- JOB_NAME: "27_nslow_nnet_COMPAT"
146-
- NOSE_ARGS="not slow and not network and not disabled"
146+
- NOSE_ARGS="--skip-slow --skip-network"
147147
- LOCALE_OVERRIDE="it_IT.UTF-8"
148148
- INSTALL_TEST=true
149149
- JOB_TAG=_COMPAT
@@ -176,15 +176,15 @@ matrix:
176176
env:
177177
- JOB_NAME: "27_slow"
178178
- JOB_TAG=_SLOW
179-
- NOSE_ARGS="slow and not network and not disabled"
179+
- NOSE_ARGS="--skip-network"
180180
- FULL_DEPS=true
181181
- CACHE_NAME="27_slow"
182182
- USE_CACHE=true
183183
- python: 3.4
184184
env:
185185
- JOB_NAME: "34_slow"
186186
- JOB_TAG=_SLOW
187-
- NOSE_ARGS="slow and not network and not disabled"
187+
- NOSE_ARGS="--skip-network"
188188
- FULL_DEPS=true
189189
- CLIPBOARD=xsel
190190
- CACHE_NAME="34_slow"
@@ -197,7 +197,7 @@ matrix:
197197
env:
198198
- JOB_NAME: "27_build_test_conda"
199199
- JOB_TAG=_BUILD_TEST
200-
- NOSE_ARGS="not slow and not disabled"
200+
- NOSE_ARGS="--skip-slow"
201201
- FULL_DEPS=true
202202
- BUILD_TEST=true
203203
- CACHE_NAME="27_build_test_conda"
@@ -206,7 +206,7 @@ matrix:
206206
env:
207207
- JOB_NAME: "35_numpy_dev"
208208
- JOB_TAG=_NUMPY_DEV
209-
- NOSE_ARGS="not slow and not network and not disabled"
209+
- NOSE_ARGS="--skip-slow --skip-network"
210210
- PANDAS_TESTING_MODE="deprecate"
211211
- CACHE_NAME="35_numpy_dev"
212212
- USE_CACHE=true
@@ -218,7 +218,7 @@ matrix:
218218
- python: 2.7
219219
env:
220220
- JOB_NAME: "27_nslow_nnet_COMPAT"
221-
- NOSE_ARGS="not slow and not network and not disabled"
221+
- NOSE_ARGS="--skip-slow --skip-network"
222222
- LOCALE_OVERRIDE="it_IT.UTF-8"
223223
- INSTALL_TEST=true
224224
- JOB_TAG=_COMPAT

appveyor.yml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ install:
9292
- cmd: '%CMD_IN_ENV% conda build ci\appveyor.recipe -q'
9393

9494
# create our env
95-
- cmd: conda create -q -n pandas python=%PYTHON_VERSION% nose
95+
- cmd: conda create -q -n pandas python=%PYTHON_VERSION% nose pytest
9696
- cmd: activate pandas
9797
- SET REQ=ci\requirements-%PYTHON_VERSION%-%PYTHON_ARCH%.run
9898
- cmd: echo "installing requirements from %REQ%"
@@ -104,4 +104,5 @@ test_script:
104104
- cd \
105105
- cmd: activate pandas
106106
- cmd: conda list
107-
- cmd: nosetests --exe -A "not slow and not network and not disabled" pandas
107+
# - cmd: nosetests --exe -A "not slow and not network and not disabled" pandas
108+
- cmd: pytest pandas --skipslow

ci/install_appveyor.ps1

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -126,8 +126,8 @@ function UpdateConda ($python_home) {
126126
function main () {
127127
InstallMiniconda $env:PYTHON_VERSION $env:PYTHON_ARCH $env:PYTHON
128128
UpdateConda $env:PYTHON
129-
InstallCondaPackages $env:PYTHON "pip setuptools nose"
129+
InstallCondaPackages $env:PYTHON "pip setuptools nose pytest"
130130
InstallCondaPackagesFromFile $env:PYTHON $env:PYTHON_VERSION $env:PYTHON_ARCH
131131
}
132132

133-
main
133+
main

ci/install_test.sh

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,8 @@ if [ "$INSTALL_TEST" ]; then
88
conda uninstall cython || exit 1
99
python "$TRAVIS_BUILD_DIR"/setup.py sdist --formats=zip,gztar || exit 1
1010
pip install "$TRAVIS_BUILD_DIR"/dist/*tar.gz || exit 1
11-
nosetests --exe -A "$NOSE_ARGS" pandas/tests/test_series.py --with-xunit --xunit-file=/tmp/nosetests_install.xml
11+
# nosetests --exe -A "$NOSE_ARGS" pandas/tests/test_series.py --with-xunit --xunit-file=/tmp/nosetests_install.xml
12+
pytest pandas/tests/test_series.py --junitxml=/tmp/pytest_install.xml
1213
else
1314
echo "Skipping installation test."
1415
fi

ci/install_travis.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ else
8585
# Useful for debugging any issues with conda
8686
conda info -a || exit 1
8787

88-
time conda create -n pandas python=$TRAVIS_PYTHON_VERSION nose coverage flake8 || exit 1
88+
time conda create -n pandas python=$TRAVIS_PYTHON_VERSION nose pytest coverage flake8 || exit 1
8989

9090
fi
9191
# build deps

ci/requirements_all.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
nose
2+
pytest
23
flake8
34
sphinx
45
ipython

ci/requirements_dev.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,6 @@ pytz
33
numpy
44
cython
55
nose
6+
pytest
7+
pytest-cov
68
flake8

ci/script.sh

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,11 +20,11 @@ fi
2020
if [ "$BUILD_TEST" ]; then
2121
echo "We are not running nosetests as this is simply a build test."
2222
elif [ "$COVERAGE" ]; then
23-
echo nosetests --exe -A "$NOSE_ARGS" pandas --with-coverage --with-xunit --xunit-file=/tmp/nosetests.xml
24-
nosetests --exe -A "$NOSE_ARGS" pandas --with-coverage --cover-package=pandas --cover-tests --with-xunit --xunit-file=/tmp/nosetests.xml
23+
echo pytest -s --cov=pandas --cov-report xml:/tmp/nosetests.xml $NOSE_ARGS pandas
24+
pytest -s --cov=pandas --cov-report xml:/tmp/nosetests.xml $NOSE_ARGS pandas
2525
else
26-
echo nosetests --exe -A "$NOSE_ARGS" pandas --doctest-tests --with-xunit --xunit-file=/tmp/nosetests.xml
27-
nosetests --exe -A "$NOSE_ARGS" pandas --doctest-tests --with-xunit --xunit-file=/tmp/nosetests.xml
26+
echo pytest --junitxml=/tmp/nosetests.xml $NOSE_ARGS pandas
27+
pytest --junitxml=/tmp/nosetests.xml $NOSE_ARGS pandas # TODO: doctest
2828
fi
2929

3030
RET="$?"

conftest.py

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
import pytest
2+
3+
4+
def pytest_addoption(parser):
5+
parser.addoption("--skip-slow", action="store_true", help="skip slow tests")
6+
parser.addoption("--skip-network", action="store_true",
7+
help="run network tests")
8+
parser.addoption("--run-disabled", action="store_true",
9+
help="run disabled tests")
10+
11+
def pytest_runtest_setup(item):
12+
if 'slow' in item.keywords and item.config.getoption("--skip-slow"):
13+
pytest.skip("skipping due to --skip-slow")
14+
15+
if 'skip' in item.keywords and item.config.getoption("--skip-network"):
16+
pytest.skip("skipping due to --skip-network")
17+
18+
if 'disabled' in item.keywords and item.config.getoption("--run-disabled"):
19+
pytest.skip("need --run-disabled option to run")

0 commit comments

Comments
 (0)