{"categories":[{"label":"Testing","url":"https://skillfed.io/packages/category/software-development-testing/4"}],"enrichment":{"capability":"A pytest plugin that detects when tests leak threads\u2014threads that remain running after a test completes\u2014and fails the test to surface the issue.","skillfed_tags":["pytest-plugin","thread-safety","test-quality"],"use_cases":["Catch tests that spawn background threads without properly joining or stopping them before test completion.","Detect thread leaks in libraries under test that may cause resource exhaustion or test isolation problems.","Enforce thread cleanup discipline across a test suite by enabling threadleak globally in pytest configuration.","Exclude known background threads (e.g., connection pools) from leak detection using regex patterns.","Debug test flakiness caused by threads from previous tests interfering with subsequent tests."],"what_it_does":"pytest-threadleak is a pytest plugin that automatically detects when a test leaves threads running after it completes. It works by checking for leaked threads after each test and failing the test if any are found. You can enable it globally via pytest.ini, per-test using the @pytest.mark.threadleak decorator, or per-module. The plugin also supports excluding specific threads by regex pattern if certain background threads are expected.\n\nThe plugin helps catch both test bugs (tests that spawn threads without cleaning them up) and issues in the code being tested (libraries that leak threads). It integrates seamlessly into your pytest workflow and requires no changes to test code beyond optionally adding markers or configuration.","worth_installing":"Yes, if you need to catch thread leaks in your tests. The plugin is simple, low-friction, and has no known vulnerabilities. However, be aware that maintenance is dormant; verify compatibility with your pytest and Python versions before relying on it in a critical pipeline. For most projects, the benefit of catching thread leaks outweighs the maintenance risk."},"id":"pytest-threadleak","links":{"html":"https://skillfed.io/packages/pytest-threadleak","md":"https://skillfed.io/packages/pytest-threadleak.md","pypi":"https://pypi.org/project/pytest-threadleak/"},"maintenance":{"status":"dormant"},"meta":{"latest_release":"2022-07-03","license_spdx":null,"license_treatment":"permissive","name":"pytest-threadleak","python_support":"unspecified","summary":"Detects thread leaks"},"popularity":{"monthly_downloads":240664,"position":8902,"tier":"top_15000"},"security":{"n_vulnerabilities":0},"version":"0.5.0"}
