The most lit ros testing framework
:fire: pyrostest :fire:
The most :fire: lit :fire: ros testing framework.
Pyrostest is a (more) pythonic framework for writing ros tests.
## Why pyrostest?
Writing rostests and rostunit tests is annoying. You have to write launch files
for all of your tests and then do strange things in your unittests and then
somehow the rostests and unittests will communicate. To be honest, I never could
get rostest to work. So I built something better. `pyrostest` allows you to test
your ros nodes in pure python, no need for xml files.
Here's a minimal example of a pyrostest test. Assume you have a ros node,
`add_one` in the ros package `pkg`. The node subscribes to `input`, a Float64
message, and published to `output`, another Float64, it adds one to the input
and publishes it. This would test that functionality
from pyrostest import RosTest, launch_node, mock_node
from std_msgs.msg import Float64
with self.mock_pub('/input', Float64, queue_size=0) as p:
with self.check_topic('/output', Float64) as r:
assert r.message.data == 8 # or self.assertEqual
This code will spin up an isolated instance of Roscore, as well as all of the
nodes needed for testing. It will then publish the float 7, and wait until the
data has been recieved, and assert about its value.
Release history Release notifications | RSS feed
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
|Filename, size||File type||Python version||Upload date||Hashes|
|Filename, size pyrostest-0.1.13.linux-x86_64.tar.gz (12.3 kB)||File type Source||Python version None||Upload date||Hashes View|
|Filename, size pyrostest-0.1.13-py3-none-any.whl (9.6 kB)||File type Wheel||Python version py3||Upload date||Hashes View|
Hashes for pyrostest-0.1.13.linux-x86_64.tar.gz
Hashes for pyrostest-0.1.13-py3-none-any.whl