Skip to content

A Pytest plugin that allows you to describe disabled tests in one or more files

License

Notifications You must be signed in to change notification settings

pomponchik/antitesting

Repository files navigation

logo

Downloads Downloads codecov Test-Package Hits-of-Code Python versions PyPI version Checked with mypy Ruff

There are standard ways to temporarily disable individual tests. As an example, using of the pytest.mark.skip decorator. This plugin adds a new way to do this by extending the standard features of Pytest. Now you can put the names of the disabled tests in a separate file, and then correct and supplement them without going into the source code of the tests.

Install the plugin:

pip install antitesting

Create one or more files containing the names of the tests that you want to disable. In our example, this will be a file disabled_tests.txt containing the text like this:

test_1
test_2 : 12.12.2012
test_3 : 12.12.2025
test_4 : 13.12.2025 # fix after test_3

Finally, add these lines to the file conftest.py:

import antitesting

antitesting("disabled_tests.txt")

The disabled_tests.txt file that we created contains the names of the tests that we want to disable. This is equivalent to putting a skip decorator on each of them, but it does not require getting into the source code of the tests and saves you time. You could also see the dates in the file in the format DD.MM.YYYY. If there is a date in this format in the line with the test name, the test will be ignored only until that date, and after that it will become available. If necessary, you can accompany the lines with comments separated by sharps ("#").

About

A Pytest plugin that allows you to describe disabled tests in one or more files

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages