Skip to content

Commit

Permalink
Run tests with pytest instead of nose (#247)
Browse files Browse the repository at this point in the history
Official nose documentation recommends users migrate to a more supported
platform.
  • Loading branch information
cottsay authored Feb 24, 2022
1 parent 2a437e8 commit d4fed1b
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 11 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@ jobs:
python -m pip install pyparsing==2.4.7 'PyYAML<6.0'
fi
python -m pip install --upgrade pip setuptools
python -m pip install nose coverage mock
python -m pip install mock pytest pytest-cov
python setup.py build develop
- name: Run tests
run: |
python -m nose --with-coverage --cover-package=rospkg --with-xunit test
python -m pytest --cov=rospkg test
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ syntax: glob
*~
*.log
.coverage
nosetests.xml
src/rospkg.egg-info
syntax: regexp
(target|build|dist)/.*
Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -27,4 +27,4 @@ testsetup:
echo "running rospkg tests"

test: testsetup
cd test && nosetests && nosetests3
cd test && pytest && pytest-3
6 changes: 3 additions & 3 deletions doc/developers_guide.rst
Original file line number Diff line number Diff line change
Expand Up @@ -45,11 +45,11 @@ Setup

::

pip install nose
pip install pytest
pip install mock


rospkg uses `Python nose <http://readthedocs.org/docs/nose/en/latest/>`_
rospkg uses `pytest <http://docs.pytest.org>`_
for testing, which is a fairly simple and straightfoward test
framework. You just have to write a function start with the name
``test`` and use normal ``assert`` statements for your tests.
Expand All @@ -62,7 +62,7 @@ You can run the tests, including coverage, as follows:
::

cd rospkg
nosetests test/*.py --with-coverage --cover-package=rospkg
pytest test --cov=rospkg


Documentation
Expand Down
4 changes: 0 additions & 4 deletions test/setup.cfg

This file was deleted.

0 comments on commit d4fed1b

Please sign in to comment.