Python flask project missing files in sonarqube

i have a python flask project where i am using the below commands to run test cases and get coverage report
pytest tests/ --cov=. --cov-report xml:coverage.xml
coverage report -m

My flask api project folder looks like below

I have which uses pytest.fixture() and a flask client for the flaskapi.

My looks like below

def client():
    app = connexion.FlaskApp(
        __name__, specification_dir=os.path.join("swagger"))
    app.add_api('openapi.yaml', validate_responses=True,
    with as c:
        yield c

I have written multiple test cases which hits the api using the client created in the conftest class. Even though the file calls other functions in, etc. In the coverage report , I can only see the file with 100%. other files in the subfolders like folder_D are not showing up in the coverage report.

Any idea on why the other python files are missing in the sonarqube,

Hey there.

SonarQube only reads coverage reports, it’s not involved in producing them. So the best first debugging step would be to actually look at the coverage.xml file being produced – is it reporting coverage on files in subfolders like folder_D?

Thanks for the reply. I think i found the issue. The python subfolders is missing files. Eventhough this is not used in higher versions of python, the coverage command has some limitations.
This is a limitation of - as soon as it discovers a directory without an file, it stops recursing (from your example, you do not seem to have any files.