Identifies duplicate unit tests
Project description
pytest_deduplicate
The pytest_deduplicate is designed to identify duplicate or superseeding unit tests that have the same or bigger code coverage. It can be particularly useful when unit tests are automatically generated based on input/output information for a function, using a large amount of available input data (for example, with the help of the auger library).
This tool groups each test together based on the coverage set. By invoking unit testing with this tool, it will collect code coverage for each test and generate a list of duplicate tests. However, it is important to note that false-positives may occur if, for example, there are regular expressions involved, as the code coverage in such cases may appear the same.
To use simply call:
pytest_deduplicate <your_project_directory>
Result example:
Duplicates:
test_collect.py:94:0: W001 tests with duplicate coverage: test_minimal_missing_both_mo (duplicate-test)
test_collect.py:195:0: W001 tests with duplicate coverage: test_mapping_couldnt_find_mo (duplicate-test)
Superseeded:
test_collect.py:83:0: W002 test test_minimal_raise_missing_mo covers more when below (bigger_coverage)
test_collect.py:62:0: W003 test test_minimal_raise_valid covers less when test_minimal_missing_mo (smaller_coverage)
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for pytest_deduplicate-0.1.3-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | c4a278f93325cd6efc9031d13c9908734beaabc252439cd8fa02fdea754d7e5d |
|
MD5 | dbec3bcddf245dec29959143fb4f8ece |
|
BLAKE2b-256 | adb3ca89e45644782e2282b74f121b72123e88317014f454442117644aaae3d8 |