# Running Python tests automatically

**URL:** <https://discourse.slicer.org/t/running-python-tests-automatically/32426>\
**Category:** SlicerDMRI\
**Tags:** python, testing\
**Created:** [October 26, 2023, 4:12pm UTC](https://discourse.slicer.org/t/running-python-tests-automatically/32426 "2023-10-26T16:12:56Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![jhlegarreta](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/jhlegarreta/32/66542_2.png) [@jhlegarreta](https://discourse.slicer.org/u/jhlegarreta)\
**Post date:** [October 26, 2023, 4:12pm UTC](https://discourse.slicer.org/t/running-python-tests-automatically/32426/1 "2023-10-26T16:12:56Z")

</div>

Hi,  
I am trying to figure out why some of the Python tests in an extension are not being executed following:  
[COMP: Update GHA workflow ensuring Slicer is built with NumPy support by jcfr · Pull Request #179 · SlicerDMRI/SlicerDMRI · GitHub](https://github.com/SlicerDMRI/SlicerDMRI/pull/179#issuecomment-1665554265)

The dashboard does show some Python test being run:  
[CDash](https://slicer.cdash.org/viewTest.php?onlypassed&buildid=3189711)

But others are not being run, e.g.  
[https://github.com/SlicerDMRI/SlicerDMRI/blob/2ba47ea8a5c03056823b91245a0710bee689ec26/Modules/Loadable/TractographyDisplay/Testing/Python/CMakeLists.txt#L12](https://github.com/SlicerDMRI/SlicerDMRI/blob/2ba47ea8a5c03056823b91245a0710bee689ec26/Modules/Loadable/TractographyDisplay/Testing/Python/CMakeLists.txt#L12)

On that list, only the first one is run (not without warnings, though):  
[Test Results](https://slicer.cdash.org/test/25880272)

I do see that the first one has some related additional CMake code in the previous link. I have tried to look for posts or documentation that explains how to write the related tests, and necessary CMake code, but have not found any relevant pointer.

Is there any resource I could have a look at to fix this situation? If not, can anybody briefly explain here how Python tests should be written and tests within an extension?

Thanks.
