Testland
Browse all skills & agents

qa-unit-tests-python

Python unit testing per-framework wrappers: 5 skills (doctest-tests, nose2-tests, pytest-asyncio-patterns, pytest-tests, unittest-tests) and 1 agent (python-test-author).

Install this plugin

/plugin install qa-unit-tests-python@testland-qa

Part of role bundle: qa-role-sdet

qa-unit-tests-python

Python unit testing per-framework wrappers. Four skills covering stdlib + community Python test frameworks: pytest (modern de facto), unittest (stdlib JUnit-port), doctest (docstring-embedded tests), nose2 (legacy alternative), plus one orchestrator that authors a single test per spec by detecting the framework convention from the project's config or existing tests.

Per-framework lifecycle scope. Does not duplicate qa-test-review (test code hygiene).

Components

TypeNameDescription
Skillpytest-testsModern de facto; fixture DI, parametrize, markers, plugin ecosystem
Skillunittest-testsStdlib JUnit-port; TestCase + setUp/tearDown; unittest.mock bundled
Skilldoctest-testsDocstring-embedded executable examples; Sphinx integration
Skillnose2-testsSuccessor to nose1 (EOL); plugin/layer model; migration path
Agentpython-test-authorAuthors one Python unit test per spec; detects pytest / unittest / doctest / nose2 from pyproject.toml / setup.cfg / tox.ini / existing test files; pairs with mimesis when present
Skillpytest-asyncio-patternsAsync testing with pytest-asyncio: markers, loop scope, AsyncMock, FastAPI/aiohttp clients.

Install

/plugin marketplace add testland/qa
/plugin install qa-unit-tests-python@testland-qa

Skills

doctest-tests

Configures and runs Python''''s stdlib doctest - embeds executable test cases in docstrings using `>>>` Python interactive prompt convention; supports `# doctest: +ELLIPSIS` / `+NORMALIZE_WHITESPACE` / `+SKIP` directives; integrates with pytest via `--doctest-modules` flag; runs as `python -m doctest module.py -v`. Use for self-documenting reference implementations + simple smoke-test coverage embedded in API docs.

nose2-tests

Configures and runs nose2 - successor to nose (the original Python test discovery library, end-of-life 2015) and an alternative to pytest's discovery model; supports plugin architecture, layers (per-test-class setUp/tearDown shared across modules), parameterized tests via `nose2.tools.params`, multi-process parallelism via mp plugin. Use when migrating from legacy nose1 codebases or when the team prefers nose2's plugin model over pytest.

pytest-asyncio-patterns

Configures and runs async Python tests with pytest-asyncio: installs the plugin, selects asyncio_mode (auto vs strict), scopes event loops (function/class/module/session), writes async fixtures with @pytest_asyncio.fixture, mocks coroutines with AsyncMock, and tests FastAPI (httpx.AsyncClient + ASGITransport) and aiohttp (aiohttp_client fixture) applications. Use when a Python project contains async def test_ functions, FastAPI/aiohttp endpoints, or any asyncio-based code that needs pytest integration. Do NOT use for general pytest fixture design, parametrize patterns, or conftest.py structure without an asyncio-specific problem (event-loop scoping, mode config, AsyncMock, ASGI client): use pytest-tests for those.

pytest-tests

Configures and runs pytest - the de facto Python test framework with fixture-based dependency injection (`@pytest.fixture` with scopes module/session/function), parametrize for table-driven tests (`@pytest.mark.parametrize`), markers (`@pytest.mark.skip` / `xfail` / `slow`), `conftest.py` for shared fixtures, plugin ecosystem (pytest-cov, pytest-asyncio, pytest-mock, pytest-xdist), `--lf`/`--ff` for fail-loop, coverage gating. Use when working with Python and needing the modern test framework.

unittest-tests

Configures and runs Python's stdlib unittest - TestCase + setUp/tearDown lifecycle hooks, assertion catalog (assertEqual / assertRaises / assertIn / assertAlmostEqual), unittest.mock module (Mock / MagicMock / patch / patch.object / patch.dict), test discovery via `python -m unittest discover`, subTest for parametrized cases, expectedFailure decorator. Use when constrained to stdlib-only (no pip install) or migrating legacy unittest codebases.