Skip to content

Missing coverage when targeting tests folder #244

@davidhuser

Description

If we additionally check the coverage of the tests folder itself, we get only 98%:

poetry run pytest --cov fastapi_azure_auth --cov=tests --cov-report=term-missing

---------- coverage: platform darwin, python 3.12.9-final-0 ----------
Name                                                   Stmts   Miss  Cover   Missing
------------------------------------------------------------------------------------
fastapi_azure_auth/__init__.py                             2      0   100%
fastapi_azure_auth/auth.py                               117      0   100%
fastapi_azure_auth/exceptions.py                          41      0   100%
fastapi_azure_auth/openid_config.py                       65      0   100%
fastapi_azure_auth/user.py                                61      0   100%
fastapi_azure_auth/utils.py                               12      0   100%
tests/__init__.py                                          0      0   100%
tests/conftest.py                                          6      0   100%
tests/multi_tenant/__init__.py                             0      0   100%
tests/multi_tenant/conftest.py                            48      0   100%
tests/multi_tenant/multi_auth/__init__.py                  0      0   100%
tests/multi_tenant/multi_auth/test_auto_error.py          30      0   100%
tests/multi_tenant/test_multi_tenant.py                  120      0   100%
tests/multi_tenant/test_settings.py                        8      1    88%   7
tests/multi_tenant/test_websocket.py                     166     22    87%   36, 48-50, 57-59, 76, 93, 121, 130, 141, 152, 165, 176, 187, 197, 207, 223, 234, 245, 256
tests/multi_tenant_b2c/__init__.py                         0      0   100%
tests/multi_tenant_b2c/conftest.py                        43      1    98%   68
tests/multi_tenant_b2c/multi_auth/__init__.py              0      0   100%
tests/multi_tenant_b2c/multi_auth/test_auto_error.py      15      0   100%
tests/multi_tenant_b2c/test_multi_tenant.py              105      0   100%
tests/multi_tenant_b2c/test_settings.py                    8      1    88%   7
tests/single_tenant/__init__.py                            0      0   100%
tests/single_tenant/conftest.py                           35      0   100%
tests/single_tenant/test_single_tenant.py                111      0   100%
tests/test_exception_compat.py                            34      0   100%
tests/test_openapi_scheme.py                              34      0   100%
tests/test_provider_config.py                             55      2    96%   36-39
tests/test_user.py                                        15      0   100%
tests/utils.py                                            46      0   100%
------------------------------------------------------------------------------------
TOTAL                                                   1177     27    98%

see this article https://nedbatchelder.com/blog/202008/you_should_include_your_tests_in_coverage.html

Metadata

Metadata

Assignees

No one assigned

    Labels

    questionFurther information is requested

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions