Better use:

.. code-block:: bash

  $ py.test