Skip to content

Commit

Permalink
PR Feedback and slight restructuring
Browse files Browse the repository at this point in the history
  • Loading branch information
DLu committed Oct 13, 2022
1 parent 6f06c1a commit 62d5c72
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 10 deletions.
2 changes: 1 addition & 1 deletion source/The-ROS2-Project/Contributing/Developer-Guide.rst
Original file line number Diff line number Diff line change
Expand Up @@ -209,7 +209,7 @@ Examples:
Testing
^^^^^^^

All packages should have some level of system, integration, and/or unit tests.
All packages should have some level of :ref:`system, integration, and/or unit tests.<TestingMain>`

**Unit tests** should always be in the package which is being tested and should make use of tools like ``Mock`` to try and test narrow parts of the code base in constructed scenarios.
Unit tests should not bring in test dependencies that are not testing tools, e.g. gtest, nosetest, pytest, mock, etc...
Expand Down
8 changes: 4 additions & 4 deletions source/Tutorials/Intermediate/Testing/Python.rst
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@
Writing Basic Tests with Python
===============================

Starting point: we'll assume you have a basic ``ament_python`` package set up already and you want to add some tests to it.
Starting point: we'll assume you have a :ref:`basic ament_python package<CreatePkg>` set up already and you want to add some tests to it.

Package Setup
=============
-------------

setup.py
^^^^^^^^
Expand Down Expand Up @@ -43,7 +43,7 @@ Example package layout:
Test Contents
=============
-------------

You can now write tests to your heart's content. There are `plenty of resources on pytest <https://docs.pytest.org>`__, but in short, you can write functions with the ``test_`` prefix and include whatever assert statements you'd like.

Expand All @@ -54,7 +54,7 @@ You can now write tests to your heart's content. There are `plenty of resources
assert 2 + 2 == 5 # This should fail for most mathematical systems
Special Commands
================
----------------

Beyond the :doc:`standard colcon testing commands <CLI>` you can also specify arguments to the ``pytest`` framework from the command line with the ``--pytest-args`` flag.
For example, you can specify the name of the function to run with
Expand Down
7 changes: 2 additions & 5 deletions source/Tutorials/Intermediate/Testing/Testing-Main.rst
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,8 @@
Testing
=======

Testing is fundamental. `See rationale from the ROS 1 wiki <http://wiki.ros.org/action/show/Quality/Tutorials/UnitTesting>`__

.. contents:: Contents
:depth: 0
:local:
Available Tutorials:
--------------------

.. toctree::
:maxdepth: 1
Expand Down

0 comments on commit 62d5c72

Please sign in to comment.