Skip to content

Commit

Permalink
[tests] shift from unittest to pytest
Browse files Browse the repository at this point in the history
  • Loading branch information
stonier committed Oct 9, 2019
1 parent 6f4fa4d commit 338d121
Show file tree
Hide file tree
Showing 6 changed files with 204 additions and 238 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ Changelog

Forthcoming
-----------
* [tests] moved from unittest to pytest
* ...

1.2.1 (2019-10-08)
Expand Down
20 changes: 1 addition & 19 deletions package.xml
Original file line number Diff line number Diff line change
Expand Up @@ -21,25 +21,7 @@

<build_depend>python3-setuptools</build_depend>

<!-- ach, autodoc is a beast, it shouldn't need these (there is a PR going in upstream for autodoc) -->
<!--
<doc_depend>actionlib</doc_depend>
<doc_depend>actionlib_msgs</doc_depend>
<doc_depend>dynamic_reconfigure</doc_depend>
<doc_depend>geometry_msgs</doc_depend>
<doc_depend>move_base_msgs</doc_depend>
<doc_depend>nav_msgs</doc_depend>
<doc_depend>python-catkin-pkg</doc_depend>
<doc_depend>python-rospkg</doc_depend>
<doc_depend>py_trees</doc_depend>
<doc_depend>py_trees_msgs</doc_depend>
<doc_depend>rosbag</doc_depend>
<doc_depend>rospy</doc_depend>
<doc_depend>sensor_msgs</doc_depend>
<doc_depend>std_msgs</doc_depend>
<doc_depend>unique_id</doc_depend>
<doc_depend>unique_identifier_msgs</doc_depend>
-->
<test_depend>python3-pytest</test_depend>

<doc_depend>python3-sphinx</doc_depend>
<doc_depend>python3-sphinx-argparse</doc_depend>
Expand Down
3 changes: 3 additions & 0 deletions setup.cfg
Original file line number Diff line number Diff line change
@@ -1,2 +1,5 @@
[pep8]
max-line-length=299

[aliases]
test=pytest
17 changes: 7 additions & 10 deletions tests/README.md
Original file line number Diff line number Diff line change
@@ -1,15 +1,12 @@
# Tests

Make sure you source the environment to run tests.

## Executing Tests
# Executing Tests

```bash
# run all tests will full stdout
$ python3 -m unittest discover
# run all tests in the current directory
$ pytest-3
# run all tests with full stdout (-s / --capture=no)
$ pytest-3 -s
# run a single test
$ cd tests && python3 ./test_action_client.py
# step back and run from setup.py (what colcon does)
$ pytest-3 -s test_alakazam.py
# run using setuptools
$ python3 setup.py test
```

0 comments on commit 338d121

Please sign in to comment.