Install Sphinx-Test-Report via pip install sphinx-test-reports.

After that the extension must to be added to the file:

extensions = ['sphinx_needs',

Please note, Sphinx-Test-Report is based on the Sphinx-needs extension. Therefore it must also be added to the extensions list!

And same for PlantUML, which is important to render flowcharts for filtered test-cases.

More details can be find in the installation-guide of Sphinx-Needs.