From c1febf8d9c91790d04cac8d42775eb0e4d7d435a Mon Sep 17 00:00:00 2001 From: "Adam J. Stewart" Date: Sat, 28 Apr 2018 10:59:33 -0500 Subject: [PATCH] Document how to run unit tests with print statements (#7860) --- lib/spack/docs/contribution_guide.rst | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/lib/spack/docs/contribution_guide.rst b/lib/spack/docs/contribution_guide.rst index 2ef27131de..0f3dabd313 100644 --- a/lib/spack/docs/contribution_guide.rst +++ b/lib/spack/docs/contribution_guide.rst @@ -97,6 +97,13 @@ tests, run: A more detailed list of available unit tests can be found by running ``spack test --long-list``. +By default, ``pytest`` captures the output of all unit tests. If you add print +statements to a unit test and want to see the output, simply run: + +.. code-block:: console + + $ spack test -s -k architecture + Unit tests are crucial to making sure bugs aren't introduced into Spack. If you are modifying core Spack libraries or adding new functionality, please consider adding new unit tests or strengthening existing tests.