Testing Python Libraries
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.
Install
/plugin marketplace add wdm0006/python-skillsThe repo is a Claude Code plugin marketplace. Run /plugin afterwards to pick the plugin that includes this skill.
npx skills add wdm0006/python-skills --skill testing-python-librariesgit clone --depth 1 https://github.com/wdm0006/python-skills.git /tmp/python-skills
mkdir -p ~/.claude/skills
cp -r /tmp/python-skills/skills/python/testing-strategy ~/.claude/skills/testing-python-librariesPersonal skills live in ~/.claude/skills. Use .claude/skills in a project folder to share a skill with your team.
From the SKILL.md
# 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, rather than patching one workflow: ```toml [tool.pytest.ini_options] addopts = "-ra -q --import-mode=importlib" ``` `importlib` mode stops pytest from mutating `sys.path`, so imports resolve only through the environment's installed distribution. Pair it with a non-editable
Details
- Skill name
testing-python-libraries- Repository
- wdm0006/python-skills
- Path
skills/python/testing-strategy/SKILL.md- License
- MIT
- Repo updated
- 18 November 2026
FAQ
What does the Testing Python Libraries skill do?
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 do I install the Testing Python Libraries skill?
Claude Code plugin: /plugin marketplace add wdm0006/python-skills. Skills go in ~/.claude/skills (personal) or .claude/skills (project), and Claude loads them automatically when a task matches the description.
Is Testing Python Libraries popular?
It lives in wdm0006/python-skills, which has 115 GitHub stars and 18 forks.
Related skills
Auditing Python Security
115wdm0006/python-skills
Audits Python libraries for security vulnerabilities using Bandit, pip-audit, Semgrep, and detect-secrets. Identifies SQL injection, command injection, hardcoded credentials, secrets exposed through tracebacks, weak cryptography, and insecure deserialization. Use when reviewing library security, setting up security scanning in CI, or implementing secure coding patterns.
Building Accessible Interfaces
115wdm0006/python-skills
Makes web and app UIs usable by keyboard, screen-reader, low-vision and motion-sensitive users — semantic HTML before ARIA, labelled controls, visible focus, WCAG AA contrast measured rather than eyeballed, touch targets, reduced motion, and automated axe checks plus a manual keyboard pass in CI or before every UI PR. Use when building or restyling a screen, adding a form, modal, menu or custom control, choosing colors, or reviewing a UI change.
Building Browser Extensions
115wdm0006/python-skills
Builds and tests Manifest V3 browser extensions — service-worker message channels that survive teardown, chrome.storage read-modify-write safety, settings validation in the popup, and a Jest chrome mock that can actually fail. Use when writing or reviewing a background service worker, a popup that reads/writes chrome.storage, an extension's Jest suite, or debugging an extension whose UI silently stops responding.
Wp Test Strategy
116jorgerosal/wordpress-skills
WordPress testing strategy and review guidance. Use when planning or reviewing PHPUnit coverage, integration tests, block tests, e2e tests, Playwright flows, WooCommerce test coverage, fixture design, or when user mentions "test strategy", "WordPress tests", "PHPUnit", "integration tests", "Playwright", "e2e", "test coverage", "testing plan", or "regression tests". Helps decide what to test, how deeply to test, and where to focus coverage in WordPress plugins, themes, blocks, and WooCommerce extensions.
Review Gate
80KerberosClaw/kc_ai_skills
Use to review a dispatch before handoff, requirements and plans before implementation, or code after implementation. Runs a fresh reviewer, then a separate context-aware adjudicator; returns evidence-backed dispositions to the main agent. Does not replace tests, acceptance checks or UI QA, and does not authorize execution or publication.
Wp Test Strategy
116jorgerosal/wordpress-skills
WordPress test strategy guidance for Codex. Use when deciding what to test, how deeply to test it, and which mix of unit, integration, and E2E coverage fits a WordPress change.
Browse the most popular Claude skills, all testing & qa skills, or write your own with the skills generator.