File tree Expand file tree Collapse file tree 5 files changed +23
-23
lines changed
Expand file tree Collapse file tree 5 files changed +23
-23
lines changed Original file line number Diff line number Diff line change 11.PHONY : all clean test
2- PYTHON =python
3- NOSETESTS =nosetests
4-
5- all :
6- $(PYTHON ) setup.py build_ext --inplace
72
83clean :
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-
2415test-code :
25- $( NOSETESTS ) -s -v imblearn
16+ py.test imblearn
2617
2718test-doc :
28- ifeq ($(BITS ) ,64)
29- $(NOSETESTS) -s -v doc/*.rst
30- endif
19+ py.test doc/* .rst
3120
3221test-coverage :
3322 rm -rf coverage .coverage
34- $( NOSETESTS ) imblearn -s -v --with-coverage --cover-package= imblearn
23+ py.test --cov=imblearn imblearn
3524
3625test : test-coverage test-doc
3726
4433code-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
Original file line number Diff line number Diff 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:
5050build : false
5151
5252test_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
5855artifacts :
5956 # Archive the generated packages in the ci.appveyor.com build report.
Original file line number Diff line number Diff line change 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
Original file line number Diff line number Diff 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
Original file line number Diff line number Diff line change @@ -32,3 +32,8 @@ doctest-tests = 1
3232doctest-extension = rst
3333doctest-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
You can’t perform that action at this time.
0 commit comments