Skip to content

Commit

Permalink
Merge pull request #3724 from takagi/bp-3623-remove-nose-runner
Browse files Browse the repository at this point in the history
[backport] remove nose dependency in tests
  • Loading branch information
okuta committed Oct 28, 2017
2 parents f6910f4 + 5aab267 commit 97e9599
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 24 deletions.
6 changes: 3 additions & 3 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ matrix:
- os: linux
python: "3.4"
- os: linux
python: "3.5.1"
python: "3.5"

- os: osx
language: generic
Expand Down Expand Up @@ -54,15 +54,15 @@ install:
- pip install dist/*.tar.gz
- pip install h5py pillow
- travis_wait pip install theano
- pip install nose pytest hacking mock
- pip install pytest hacking mock
- pip install autopep8

script:
- flake8
- autopep8 -r . --global-config .pep8 --diff | tee check_autopep8
- test ! -s check_autopep8
- cd tests
- CHAINER_TEST_GPU_LIMIT=0 PYTHONWARNINGS='ignore::FutureWarning,module::DeprecationWarning' pytest -m "not gpu and not multi_gpu and not slow and not cudnn" chainer_tests
- CHAINER_TEST_GPU_LIMIT=0 PYTHONWARNINGS='ignore::FutureWarning,error::DeprecationWarning,ignore::DeprecationWarning:site' pytest -m "not gpu and not multi_gpu and not slow and not cudnn" chainer_tests
- if [[ $TRAVIS_OS_NAME == "linux" ]]; then
cd ..;
READTHEDOCS=True python setup.py develop;
Expand Down
2 changes: 1 addition & 1 deletion appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ build_script:
test_script:
# Run the project tests
- "%CMD_IN_ENV% pip install mock hacking"
- "%CMD_IN_ENV% pip install nose pytest pytest-timeout pytest-cov"
- "%CMD_IN_ENV% pip install pytest pytest-timeout pytest-cov"
- "flake8"
# Avoid interuption confirmation of cmd.exe
- "echo SET CHAINER_TEST_GPU_LIMIT=0 > tmp.bat"
Expand Down
7 changes: 2 additions & 5 deletions chainer/testing/__init__.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
import nose

from chainer.testing import array # NOQA
from chainer.testing import helper # NOQA
from chainer.testing import parameterized # NOQA
Expand Down Expand Up @@ -31,6 +29,5 @@ def run_module(name, file):
"""

if name == '__main__':

nose.runmodule(argv=[file, '-vvs', '-x', '--pdb', '--pdb-failure'],
exit=False)
import pytest
pytest.main([file, '-vvs', '-x', '--pdb'])
13 changes: 0 additions & 13 deletions chainer/testing/unary_math_function_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -116,15 +116,6 @@ def unary_math_function_unittest(func, func_expected=None, label_expected=None,
Because the test methods are implicitly injected to ``TestSin`` class by
the decorator, it is enough to place ``pass`` in the class definition.
Now the test is run with ``nose`` module.
.. doctest::
>>> import nose
>>> nose.run(
... defaultTest=__name__, argv=['', '-a', '!gpu'], exit=False)
True
To customize test data, ``make_data`` optional parameter can be used.
The following is an example of testing ``sqrt`` Chainer function, which
is tested in positive value domain here instead of the default input.
Expand All @@ -143,10 +134,6 @@ def unary_math_function_unittest(func, func_expected=None, label_expected=None,
... make_data=make_data)
... class TestSqrt(unittest.TestCase):
... pass
...
>>> nose.run(
... defaultTest=__name__, argv=['', '-a', '!gpu'], exit=False)
True
``make_data`` function which returns input, gradient and double gradient
data generated in proper value domains with given ``shape`` and
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,9 @@
import itertools
import nose.tools
import six

from chainer import testing


@nose.tools.nottest
def pooling_patches(dims, ksize, stride, pad, cover_all):
"""Return tuples of slices that indicate pooling patches."""
# Left-top indexes of each pooling patch.
Expand Down

0 comments on commit 97e9599

Please sign in to comment.