Skip to main content

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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pytest_deduplicate-0.1.3.tar.gz (15.6 kB view hashes)

Uploaded Source

Built Distribution

pytest_deduplicate-0.1.3-py3-none-any.whl (16.0 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page