Skip to content
This repository was archived by the owner on Dec 6, 2023. It is now read-only.

Commit 7fb1822

Browse files
authored
migrate from nose to pytest (#163)
* migrate from nose to pytest * RDP
1 parent 6b3699b commit 7fb1822

File tree

5 files changed

+8
-20
lines changed

5 files changed

+8
-20
lines changed

.travis.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,9 @@ install:
1717
# Useful for debugging any issues with conda
1818
- conda info -a
1919

20-
- conda create -q -n test-environment python=$PYTHON_VERSION numpy scipy nose cython scikit-learn six joblib
20+
- conda create -q -n test-environment python=$PYTHON_VERSION numpy scipy pytest cython scikit-learn six joblib
2121
- source activate test-environment
2222
- make all
2323

2424
script:
25-
- nosetests -v
25+
- pytest -v --pyargs lightning

README.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ Dependencies
6767
------------
6868

6969
lightning requires Python >= 2.7, setuptools, Numpy >= 1.3, SciPy >= 0.7 and
70-
scikit-learn >= 0.15. Building from source also requires Cython and a working C/C++ compiler. To run the tests you will also need nose >= 0.10.
70+
scikit-learn >= 0.15. Building from source also requires Cython and a working C/C++ compiler. To run the tests you will also need pytest.
7171

7272
Installation
7373
------------

appveyor.yml

+2-10
Original file line numberDiff line numberDiff line change
@@ -52,23 +52,15 @@ install:
5252
- "python -c \"import struct; print(struct.calcsize('P') * 8)\""
5353
- "python -m pip --version"
5454

55-
- "python -m pip install --timeout=60 numpy scipy cython nose scikit-learn wheel six joblib"
55+
- "python -m pip install --timeout=60 numpy scipy cython pytest scikit-learn wheel six joblib"
5656
- "python setup.py bdist_wheel bdist_wininst"
5757

5858
- ps: "ls dist"
5959
# Install the generated wheel package to test it
6060
- "python -m pip install --pre --no-index --find-links dist/ sklearn-contrib-lightning"
6161

6262
test_script:
63-
# Change to a non-source folder to make sure we run the tests on the
64-
# installed library.
65-
- "mkdir empty_folder"
66-
- "cd empty_folder"
67-
68-
- "python -c \"import nose; nose.main()\" -s -v lightning"
69-
70-
# Move back to the project folder
71-
- "cd .."
63+
- "pytest -v --pyargs lightning"
7264

7365
artifacts:
7466
# Archive the generated wheel package in the ci.appveyor.com build report.

build_tools/windows/windows_testing_downloader.ps1

+3-3
Original file line numberDiff line numberDiff line change
@@ -114,8 +114,8 @@ function PipInstall($pkg_name, $python_version, $extra_args) {
114114
Invoke-Expression -Command "$pip install $pkg_name"
115115
}
116116

117-
function InstallNose($python_version) {
118-
PipInstall "nose" $python_version
117+
function InstallPytest($python_version) {
118+
PipInstall "pytest" $python_version
119119
}
120120

121121
function WheelInstall($name, $url, $python_version) {
@@ -254,7 +254,7 @@ function main {
254254
} else {
255255
EnsurePip $py
256256
}
257-
InstallNose $py
257+
InstallPytest $py
258258
InstallWheel $py
259259

260260
# The installers below here use wheel packages.

lightning/impl/tests/test_sag.py

-4
Original file line numberDiff line numberDiff line change
@@ -473,7 +473,3 @@ def test_sag_adaptive():
473473
eta='auto', loss='log', random_state=0, alpha=alpha, max_iter=20)
474474
clf.fit(X, y)
475475
np.testing.assert_almost_equal(clf_adaptive.score(X, y), clf.score(X, y), 1)
476-
477-
if __name__ == '__main__':
478-
import nose
479-
nose.run()

0 commit comments

Comments
 (0)