py.test unit testing integration support

See ‘samples/simple’ for an example test program that starts the robot
code and runs it through autonomous mode and operator mode.

To run the unit tests, just run your robot.py with the following arguments:

$ python3 robot.py test

For more information on how to write py.test tests, see the documentation
at http://pytest.org , or refer to the samples directory for examples.

robot simulator

The pyfrc robot simulator allows very simplistic simulation of your code
in real time and displays the results in a (ugly) user interface. To run
the simulator, run your robot.py with the following arguments:

$ python3 robot.py sim

As there is interest, I will add more features to the simulator.

Implementation Notes

SmartDashboard/NetworkTables support

TODO

Internals

The implementation of wpilib that you can run on your computer is contained
in the ‘lib’ directory. If you use the ‘run_test.py’ script to run your
tests, it will automatically setup the python path correctly so that loading
fake_wpilib will load the correct package.

The lib/pyfrc/wpilib directory is the code for wpilib directly copied from
the RobotPy implementation. This code tries to load a module called ‘_wpilib’,
which is a binary python module on the robot. However, in the directory
lib/pyfrc/wpilib/_wpilib there is a python package which emulates a lot of
the functionality found in the binary package for wpilib.

The StartCompetition function is monkey-patched by run_test.py so that the
library and test runners can load properly.