From partme-ai-full-stack-skills
Guides pytest usage for Python unit testing including test writing, fixtures, parametrization, mocking, configuration, coverage reports, and parallel execution.
npx claudepluginhub partme-ai/full-stack-skills --plugin t2ui-skillsThis skill uses the workspace's default tool permissions.
Use this skill whenever the user wants to:
Creates isolated Git worktrees for feature branches with prioritized directory selection, gitignore safety checks, auto project setup for Node/Python/Rust/Go, and baseline verification.
Executes implementation plans in current session by dispatching fresh subagents per independent task, with two-stage reviews: spec compliance then code quality.
Dispatches parallel agents to independently tackle 2+ tasks like separate test failures or subsystems without shared state or dependencies.
Use this skill whenever the user wants to:
pytest-mock or unittest.mockpytest.ini, pyproject.toml, or conftest.pypytest-covpytest-xdisttest_ prefix or Test classconftest.py for shared setup and dependency injectionpytest CLI, applying markers and filters as neededdef test_addition():
assert 1 + 1 == 2
def test_string_upper():
assert "hello".upper() == "HELLO"
import pytest
@pytest.fixture
def sample_user():
return {"name": "Alice", "email": "alice@example.com"}
def test_user_name(sample_user):
assert sample_user["name"] == "Alice"
@pytest.fixture(autouse=True)
def reset_database(db):
db.clear()
yield
db.clear()
import pytest
@pytest.mark.parametrize("input,expected", [
("hello", 5),
("", 0),
("pytest", 6),
])
def test_string_length(input, expected):
assert len(input) == expected
def test_api_call(mocker):
mock_get = mocker.patch("requests.get")
mock_get.return_value.json.return_value = {"status": "ok"}
result = fetch_status()
assert result == "ok"
mock_get.assert_called_once()
# Run all tests
pytest
# Verbose with pattern filter
pytest -v -k "test_user"
# With coverage
pytest --cov=mypackage --cov-report=html
# Parallel execution
pytest -n auto
conftest.py for shared fixtures--cov for coverage and --maxfail=1 to fail fast@pytest.mark.slow) to categorize tests and run subsetspytest, Python testing, fixtures, parametrize, mocking, conftest, coverage, pytest-cov, pytest-xdist, unit testing, markers