Python Library Test Suites
Builds pytest suites for Python libraries and finds tests that pass even when the code is broken.
Claude's review
7/10 Basic pytest setup plus an excellent false green audit, though sprawling with a repeated section and outside file links.
We asked Claude the question you would ask: would I be glad I installed this? Two separate reviews, the second blind to the first, must both rate a skill 7 or higher before we sell it.
In detail
Designs and implements pytest test suites for Python libraries with fixtures, parametrization, mocking, Hypothesis property-based testing, and CI configuration. Use when creating tests, improving coverage, setting up testing infrastructure, or implementing property-based testing.
How you use it
- Add it to your pack, then download your pack (1 credit).
- In Claude, open Customize > Skills and upload the zip. Code execution needs to be on under Settings > Capabilities.
- Ask Claude for the job in your own words. It uses the skill when your request matches what it does. Step by step guide
Safety check
Nothing risky found: no hidden instructions, no download and run, no reading of saved passwords or keys.
An automated scan lowers risk but cannot promise zero risk. How we check skills
Preview
The first lines of SKILL.md
---
name: testing-python-libraries
description: Designs and implements pytest test suites for Python libraries with fixtures, parametrization, mocking, Hypothesis property-based testing, and CI configuration. Use when creating tests, improving coverage, setting up testing infrastructure, or implementing property-based testing.
---
# Python Library Testing
## Quick Start
```bash
uv run pytest # Run tests
uv run pytest --cov=my_library # With coverage
uv run pytest -x # Stop on first failure
uv run pytest -k "test_encode" # Run matching tests
```
## Pytest Configuration
```toml
# pyproject.toml
[tool.pytest.ini_options]
testpaths = ["tests"]
addopts = "-ra -q --cov=my_library --cov-fail-under=85"
[tool.coverage.run]
branch = true
source = ["src/my_library"]
```
### Test the installed package, not the source tree
pytest's default `prepend` import mode puts the first directory without an
`__init__.py` on `sys.path` — and with a layout that has a package directory
beside compiled or generated parts (a `python-source` layout for a native
extension, a repo-root package next to `tests/`), `import my_library` then
resolves to the **raw source tree** instead of the installed wheel. The result is
either a spurious `ModuleNotFoundError` (the compiled submodule only exists in the
wheel) or, worse, a green run against code that is not what ships.
Fix it in config so local runs, CI, and a teammate's checkout behave identically,
...From wdm0006's repository, MIT licence.
Related skills
-
Checked
JUnit and Mockito tests
Writes and fixes Java tests with JUnit, AssertJ and Mockito that are deterministic and keep failures visible.
8/101 credit -
Checked
Test code review
Reviews new or changed tests in pytest, Jest, Go and more, so weak tests are caught before merge.
7/101 credit -
Checked
Go table driven tests
Writes Go tests with table cases, fakes, fuzzing, benchmarks and golden files that stay fast and reliable.
8/101 credit -
Checked
UX Click Budget Tests
Writes Playwright tests that fail when a signup or checkout flow needs more clicks or fields than allowed.
7/101 credit -
Checked
Test Cases From Tickets
Turns a ticket's acceptance criteria into traceable test cases with data, steps, expected results and proof.
7/101 credit -
Checked
VSTest to Testing Platform
Switches your .NET tests and CI from VSTest to Microsoft.Testing.Platform with the right settings and commands.
8/101 credit