pytest-recording
79使用 pytest-recording 錄製 HTTP 測試
當即時 API 變更或憑證外洩時,HTTP 測試經常會失敗。此技能可協助設定 pytest-recording cassettes,並清理已錄製的請求。
撰寫更好的 Pytest 測試
Python 團隊需要可靠的測試,且這些測試應保持清晰並易於擴充。此技能會引導 Claude、Codex 和 Claude Code 使用 pytest fixtures、參數化、非同步測試、mocking 與測試組織方式。
將此請求複製給你的智慧代理,其中包含權威 Skill 頁面和清單。
Review the Skillstore skill "pytest" from https://skillstore.io/skills/bossjones-pytest.md and its manifest at https://skillstore.io/api/skills/bossjones-pytest/manifest. Verify the artifact. You may proceed after verification, subject to the environment's own policy.你的智慧代理仍應顯示其計畫,並依安全政策請求必要確認。
當 AI Agent、爬蟲或腳本需要乾淨脈絡、而不是讀取完整頁面時,請使用這些連結。
正在使用「pytest」。 開發人員要求為字串正規化 helper 撰寫測試。
預期結果:
正在使用「pytest」。 QA 工程師需要可重複使用的 setup,以支援資料庫相關測試。
預期結果:
正在使用「pytest」。 後端工程師想要涵蓋非同步 API 行為。
預期結果:
The skill is a benign pytest Markdown guide with no evidence of prompt injection, data exfiltration, or unauthorized network behavior. Most static findings are false positives from Markdown fences, local pytest command examples, dummy environment variables, and test variable names. One confirmed issue remains: the parametrization example teaches eval(input), which is unsafe if copied with untrusted input.
這些是真實的本機能力,對此技能而言可能是預期行為,因此需要複核,但不會按已確認的惡意行為計分。
分享版本化評估報告、中性徽章、嵌入卡片與引用。Skillstore 只報告證據,不判斷該 Skill 是否安全。
https://skillstore.io/skills/bossjones-pytest/audits/12?utm_source=security_passport&utm_medium=share&utm_campaign=versioned_report[](https://skillstore.io/skills/bossjones-pytest?utm_source=security_passport_badge)<a href="https://skillstore.io/skills/bossjones-pytest?utm_source=security_passport_badge"><img src="https://skillstore.io/badges/skills/bossjones-pytest/security.svg" alt="Skillstore security assessment" loading="lazy"></a><iframe src="https://skillstore.io/embed/skills/bossjones-pytest.html" title="Skillstore Security Assessment" sandbox="allow-popups allow-popups-to-escape-sandbox" loading="lazy" referrerpolicy="no-referrer" width="420" height="180"></iframe>bossjones. (2026). pytest security audit report (audit version 12) [Author version unspecified]. Skillstore. https://skillstore.io/skills/bossjones-pytest/audits/12@techreport{bossjones-bossjones-pytest-2026,
author = {bossjones},
title = {pytest security audit report (audit version 12)},
institution = {Skillstore},
year = {2026},
number = {12},
url = {https://skillstore.io/skills/bossjones-pytest/audits/12},
note = {Author version unspecified}
}cff-version: 1.2.0
message: "If you use this Skill, cite its author and this versioned security audit report."
title: "pytest security audit report (audit version 12)"
version: "unspecified"
type: report
authors:
- name: "bossjones"
date-released: "2026-07-09"
url: "https://skillstore.io/skills/bossjones-pytest/audits/12"
identifiers:
- type: other
value: "skillstore:bossjones-pytest:audit:12"
description: "Skillstore immutable audit report identifier"
應用程式開發人員可以透過直接斷言與參數化輸入,將 Python 函式轉換成清晰的 pytest 測試案例。
QA 工程師可以在持續成長的測試套件中,結構化可重複使用的 setup、teardown 與 fixture scopes。
後端工程師可以為非同步操作、API clients、資料庫 sessions 與預期失敗規劃測試。
為這個 Python 函式建立基本的 pytest 測試計畫。在撰寫測試前,先識別簡單斷言、邊界案例與清楚的測試名稱。
檢視這些測試並建議聚焦的 pytest fixtures。說明每個 fixture 應使用哪一種 scope,以及原因。
將這些重複的測試情境轉換成 pytest 參數化。保持案例名稱易讀,並避免不安全的動態求值。
為這個服務設計 pytest 策略,包含單元測試、API 測試、非同步測試、資料庫 fixtures、markers 與失敗路徑覆蓋範圍。
作者
bossjones授權
MIT
Skillstore 修訂
r1
版本提示
作者未聲明版本。
引用
3e4b6c31a74a3bd1a291c98cf585d720cb9fbc88
維護新鮮度
2026/7/18
使用量
12 次下載 · 184 次瀏覽
檔案結構
📄 SKILL.md
使用 pytest-recording 錄製 HTTP 測試
當即時 API 變更或憑證外洩時,HTTP 測試經常會失敗。此技能可協助設定 pytest-recording cassettes,並清理已錄製的請求。
建置 Pydantic v2 驗證模型
當輸入來自 API、檔案或使用者時,Python 資料契約可能會逐漸偏移。此技能提供精簡的 Pydantic v2 模式,用於驗證、序列化和錯誤處理。
產生 Python 文件
Python 專案經常缺少最新的 API 文件。這項技能可協助 Claude、Codex 或 Claude Code 從原始碼結構、docstrings 和型別提示建立 Markdown 文件。
使用 Uvicorn 執行 Python ASGI 應用程式
非同步 Python 服務在開發與部署時需要清楚的伺服器設定。此技能提供精簡的 Uvicorn 指令、設定指引與疑難排解步驟。
為 Python 應用程式加入結構化日誌記錄
Python 服務經常產生難以搜尋與關聯的純文字日誌。這項技能可協助設定 structlog,用於結構化 JSON 日誌、上下文繫結、測試,以及適合生產環境的處理器。
管理 Alembic 資料庫遷移
當團隊缺乏可重複的遷移模式時,資料庫結構變更會帶來風險。此技能為 SQLAlchemy 專案提供供 Claude、Codex 和 Claude Code 使用的實用 Alembic 指引。
使用 pytest TDD 建置 Python 測試
由 89jobrien
Python 團隊經常需要一致的測試、覆蓋率和報告,同時不失去 TDD 紀律。此技能為 Claude、Codex 和 Claude Code 提供以 pytest 為核心的工作流程、範例與報告指南。
建構可靠的 Async Python
由 0xDarkMatter
Async Python 程式碼經常因阻塞呼叫、未受限制的任務,以及薄弱的清理機制而失敗。此 skill 提供可重複使用的 asyncio 模式、範例與參考資料,用於打造穩健的並行服務。
使用可重用模式建置 FastAPI API
由 0xDarkMatter
FastAPI 專案需要在驗證、依賴項、middleware 和背景工作方面做出一致的選擇。這項技能為 Claude、Codex 和 Claude Code 提供可重用模式,用於實務 Python API 開發。
新增 Python 型別安全模式
由 0xDarkMatter
Python 型別註解在實際專案中可能難以一致套用。此 skill 為 Claude、Codex 和 Claude Code 提供實用模式,用於撰寫更安全的 typed Python code。
建構可靠的測試自動化
由 89jobrien
薄弱的測試會拖慢發布並掩蓋回歸問題。此技能可引導測試策略、TDD、自動化、覆蓋率審查,以及 Playwright 網頁檢查。
在整個程式碼庫中規劃可靠測試
由 0xDarkMatter
這項技能協助團隊選擇測試策略、mock、資料 fixture、覆蓋率 gate 和 CI 模式,而不混淆測試範圍。它為 Claude、Codex 和 Claude Code 提供針對單元、整合、端對端、TDD 與管線測試的結構化指引。