Skip to content

Commit 8086fdb

Browse files
committed
CI move CI to pytest
1 parent 4ea3bcc commit 8086fdb

File tree

5 files changed

+23
-23
lines changed

5 files changed

+23
-23
lines changed

Makefile

Lines changed: 3 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,4 @@
11
.PHONY: all clean test
2-
PYTHON=python
3-
NOSETESTS=nosetests
4-
5-
all:
6-
$(PYTHON) setup.py build_ext --inplace
72

83
clean:
94
find . -name "*.so" -o -name "*.pyc" -o -name "*.md5" -o -name "*.pyd" -o -name "*~" | xargs rm -f
@@ -17,21 +12,15 @@ clean:
1712
rm -rf doc/modules
1813
rm -rf examples/.ipynb_checkpoints
1914

20-
in: inplace # just a shortcut
21-
inplace:
22-
$(PYTHON) setup.py build_ext -i
23-
2415
test-code:
25-
$(NOSETESTS) -s -v imblearn
16+
py.test imblearn
2617

2718
test-doc:
28-
ifeq ($(BITS),64)
29-
$(NOSETESTS) -s -v doc/*.rst
30-
endif
19+
py.test doc/*.rst
3120

3221
test-coverage:
3322
rm -rf coverage .coverage
34-
$(NOSETESTS) imblearn -s -v --with-coverage --cover-package=imblearn
23+
py.test --cov=imblearn imblearn
3524

3625
test: test-coverage test-doc
3726

@@ -44,6 +33,3 @@ conda:
4433
code-analysis:
4534
flake8 imblearn | grep -v __init__
4635
pylint -E imblearn/ -d E1103,E0611,E1101
47-
48-
flake8-diff:
49-
./build_tools/travis/flake8_diff.sh

appveyor.yml

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ install:
3939
- "conda install pip numpy scipy scikit-learn=0.19.0 nose wheel matplotlib -y -q"
4040

4141
# Install other nilearn dependencies
42-
- "pip install coverage nose-timer"
42+
- "pip install coverage nose-timer pytest pytest-cov"
4343
- "python setup.py bdist_wheel"
4444
- ps: "ls dist"
4545

@@ -50,10 +50,7 @@ install:
5050
build: false
5151

5252
test_script:
53-
# Change to a non-source folder to make sure we run the tests on the
54-
# installed library.
55-
- "cd C:\\"
56-
- "python -c \"import nose; nose.main()\" -v -s --with-timer --timer-top-n 50 imblearn"
53+
- powershell ./build_tools/appveyor/test.ps1
5754

5855
artifacts:
5956
# Archive the generated packages in the ci.appveyor.com build report.

build_tools/appveyor/test.ps1

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
# Change to a non-source folder to make sure we run the tests on the
2+
# installed library.
3+
- "cd C:\\"
4+
5+
$installed_imblearn_folder = $(python -c "import os; os.chdir('c:/'); import imblearn;\
6+
print(os.path.dirname(pydicom.__file__))")
7+
echo "imblearn found in: $installed_imblearn_folder"
8+
9+
# --pyargs argument is used to make sure we run the tests on the
10+
# installed package rather than on the local folder
11+
py.test --pyargs imblearn $installed_imblearn_folder
12+
exit $LastExitCode

build_tools/travis/test_script.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ run_tests(){
2121
python -c "import scipy; print('scipy %s' % scipy.__version__)"
2222
python -c "import multiprocessing as mp; print('%d CPUs' % mp.cpu_count())"
2323

24-
nosetests -v -s --with-coverage --cover-package=$MODULE $MODULE
24+
py.test --cov=$MODULE -r sx --pyargs $MODULE
2525

2626
# Test doc
2727
cd $OLDPWD

setup.cfg

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,3 +32,8 @@ doctest-tests = 1
3232
doctest-extension = rst
3333
doctest-fixtures = _fixture
3434

35+
[tool:pytest]
36+
# disable-pytest-warnings should be removed once we drop nose and we
37+
# rewrite tests using yield with parametrize
38+
addopts =
39+
--doctest-modules

0 commit comments

Comments
 (0)