diazona/setuptools-pyproject-migration

Exclude generated files from coverage

diazona opened this issue · 0 comments

The distribution package tests create a lot of Python files in temporary directories which get picked up by our coverage tool, but those files are from external packages and shouldn't be counted in our test coverage statistics. For example, everything under /tmp/pytest-of-diazona/pytest-104 here:

$ tox run -e py311 -- 'tests/distribution/test_distribution_packages.py'
[...]
---------- coverage: platform linux, python 3.11.6-final-0 -----------
Name                                                                                                                                                           Stmts   Miss  Cover   Missing
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
/tmp/pytest-of-diazona/pytest-104/aioax25==0.0.11.post00/project/aioax25-0.0.11.post0/aioax25/__init__.py                                                          5      0   100%
/tmp/pytest-of-diazona/pytest-104/pytest==7.3.00/project/pytest-7.3.0/.eggs/setuptools_scm-8.0.4-py3.11.egg/setuptools_scm/__init__.py                            11      0   100%
/tmp/pytest-of-diazona/pytest-104/pytest==7.3.00/project/pytest-7.3.0/.eggs/setuptools_scm-8.0.4-py3.11.egg/setuptools_scm/_config.py                             80      7    91%   40, 44, 56, 67, 71-77
/tmp/pytest-of-diazona/pytest-104/pytest==7.3.00/project/pytest-7.3.0/.eggs/setuptools_scm-8.0.4-py3.11.egg/setuptools_scm/_entrypoints.py                        77     40    48%   15-16, 23-38, 70-74, 79-83, 91-106, 116, 126, 135-139
/tmp/pytest-of-diazona/pytest-104/pytest==7.3.00/project/pytest-7.3.0/.eggs/setuptools_scm-8.0.4-py3.11.egg/setuptools_scm/_get_version_impl.py                   73     31    58%   27-33, 40-42, 75-82, 95, 98-99, 112, 151-159, 163-174
/tmp/pytest-of-diazona/pytest-104/pytest==7.3.00/project/pytest-7.3.0/.eggs/setuptools_scm-8.0.4-py3.11.egg/setuptools_scm/_integration/__init__.py                0      0   100%
/tmp/pytest-of-diazona/pytest-104/pytest==7.3.00/project/pytest-7.3.0/.eggs/setuptools_scm-8.0.4-py3.11.egg/setuptools_scm/_integration/dump_version.py           36      7    81%   49-55, 65-66, 71, 92
/tmp/pytest-of-diazona/pytest-104/pytest==7.3.00/project/pytest-7.3.0/.eggs/setuptools_scm-8.0.4-py3.11.egg/setuptools_scm/_integration/pyproject_reading.py      53     21    60%   26, 37-43, 58-59, 65-69, 72, 74, 76-84
/tmp/pytest-of-diazona/pytest-104/pytest==7.3.00/project/pytest-7.3.0/.eggs/setuptools_scm-8.0.4-py3.11.egg/setuptools_scm/_integration/setuptools.py             62     22    65%   30, 56, 75-101, 113, 115, 118-119
/tmp/pytest-of-diazona/pytest-104/pytest==7.3.00/project/pytest-7.3.0/.eggs/setuptools_scm-8.0.4-py3.11.egg/setuptools_scm/_integration/toml.py                   37     12    68%   15, 18, 31-36, 51-55
/tmp/pytest-of-diazona/pytest-104/pytest==7.3.00/project/pytest-7.3.0/.eggs/setuptools_scm-8.0.4-py3.11.egg/setuptools_scm/_log.py                                59     25    58%   20, 24, 35-38, 60-69, 74-85
/tmp/pytest-of-diazona/pytest-104/pytest==7.3.00/project/pytest-7.3.0/.eggs/setuptools_scm-8.0.4-py3.11.egg/setuptools_scm/_modify_version.py                     30     21    30%   9-10, 14-18, 22-33, 37-45, 49-54, 60-61
/tmp/pytest-of-diazona/pytest-104/pytest==7.3.00/project/pytest-7.3.0/.eggs/setuptools_scm-8.0.4-py3.11.egg/setuptools_scm/_overrides.py                          28      2    93%   28, 47
/tmp/pytest-of-diazona/pytest-104/pytest==7.3.00/project/pytest-7.3.0/.eggs/setuptools_scm-8.0.4-py3.11.egg/setuptools_scm/_run_cmd.py                            95     57    40%   20, 41, 55, 64, 72-77, 90-93, 108-119, 123-126, 138-170, 175-176, 182-198, 206-207
/tmp/pytest-of-diazona/pytest-104/pytest==7.3.00/project/pytest-7.3.0/.eggs/setuptools_scm-8.0.4-py3.11.egg/setuptools_scm/_types.py                              16      2    88%   13-14
/tmp/pytest-of-diazona/pytest-104/pytest==7.3.00/project/pytest-7.3.0/.eggs/setuptools_scm-8.0.4-py3.11.egg/setuptools_scm/_version_cls.py                        51     25    51%   10-12, 29-32, 36, 40, 46-48, 52, 54, 62-66, 73-78, 83-91
/tmp/pytest-of-diazona/pytest-104/pytest==7.3.00/project/pytest-7.3.0/.eggs/setuptools_scm-8.0.4-py3.11.egg/setuptools_scm/discover.py                            33      3    91%   25, 39, 65
/tmp/pytest-of-diazona/pytest-104/pytest==7.3.00/project/pytest-7.3.0/.eggs/setuptools_scm-8.0.4-py3.11.egg/setuptools_scm/fallbacks.py                           33     12    64%   9, 29, 33-44
/tmp/pytest-of-diazona/pytest-104/pytest==7.3.00/project/pytest-7.3.0/.eggs/setuptools_scm-8.0.4-py3.11.egg/setuptools_scm/integration.py                         16      0   100%
/tmp/pytest-of-diazona/pytest-104/pytest==7.3.00/project/pytest-7.3.0/.eggs/setuptools_scm-8.0.4-py3.11.egg/setuptools_scm/version.py                            226    136    40%   20-23, 49-70, 74-82, 91-107, 112-113, 147, 150, 157, 173, 182-183, 191-196, 226-227, 231-234, 240-250, 254-262, 268-289, 293-299, 303-306, 321, 336-381, 385-395, 403, 407, 411, 415, 419-422, 431-440
src/setuptools_pyproject_migration/__init__.py                                                                                                                   155     14    91%   48, 138, 155, 231-241, 329, 345, 375, 390, 394, 403
test_support/test_support/__init__.py                                                                                                                             77     26    66%   23-24, 68, 112-123, 132, 141-147, 159-162, 176-177, 186, 220-222
test_support/test_support/distribution.py                                                                                                                        274     37    86%   35-46, 51-52, 67, 87, 125, 132, 138, 176, 311-314, 350, 358, 409-410, 444-445, 469, 504, 506, 512-513, 533-537, 555-556, 561-564, 567-569, 589
test_support/test_support/metadata.py                                                                                                                            131     27    79%   16-34, 46, 51-53, 56, 58, 103, 114, 116, 129, 140, 169, 177, 192, 203-204, 208, 215
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
TOTAL                                                                                                                                                           1658    527    68%
[...]