[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"project-80950":3},{"id":4,"name":5,"fullName":6,"owner":7,"repo":5,"description":8,"homepage":9,"htmlUrl":10,"language":11,"languages":10,"totalLinesOfCode":10,"stars":12,"forks":13,"watchers":14,"openIssues":15,"contributorsCount":15,"subscribersCount":15,"size":15,"stars1d":16,"stars7d":16,"stars30d":16,"stars90d":15,"forks30d":15,"starsTrendScore":17,"compositeScore":18,"rankGlobal":10,"rankLanguage":10,"license":10,"archived":19,"fork":19,"defaultBranch":20,"hasWiki":19,"hasPages":21,"topics":22,"createdAt":10,"pushedAt":10,"updatedAt":29,"readmeContent":30,"aiSummary":31,"trendingCount":15,"starSnapshotCount":15,"syncStatus":32,"lastSyncTime":33,"discoverSource":34},80950,"pytest-fastprom","Lujeni\u002Fpytest-fastprom","Lujeni","Turn your SLOs into pytest assertions.","https:\u002F\u002Flujeni.github.io\u002Fpytest-fastprom\u002F",null,"Python",32,19,31,0,1,3,43.5,false,"main",true,[23,24,25,26,27,28],"fastapi","performance-testing","prometheus","pytest","pytest-plugin","smoke-test","2026-06-12 04:01:31","# pytest-fastprom\n\n**Turn your SLOs into pytest assertions.**\n\nSmoketest your FastAPI against the latency and error budgets you actually promised. Built on the Prometheus metrics your app already exposes, not wall-clock `timeit` guesses.\n\n```python\ndef test_home_meets_slo(instrumented_client, metrics):\n    instrumented_client.get(\"\u002F\")\n    metrics.assert_p99_below(1.0, handler=\"\u002F\")\n    metrics.assert_no_server_errors()\n```\n\nOr declare the SLO right on the test:\n\n```python\n@pytest.mark.metrics(p99_below=1.0, min_requests=3, no_errors=True)\ndef test_route_within_budget(instrumented_client):\n    for _ in range(3):\n        instrumented_client.get(\"\u002F\")\n```\n\n## Features\n\n- **Prometheus-native**. Asserts on real histogram metrics, not stopwatch timing.\n- **Isolated** registry per test. No metric leaks between tests.\n- **SLO assertions** on P50, P99, request counts, and error rates.\n- **Custom metrics**. `assert_metric` checks any Counter\u002FGauge\u002FHistogram your app exposes.\n- **Error budgets**. `max_error_rate` \u002F `max_4xx_rate` assert a ratio, not just a zero count.\n- **Regression detection**. Save a baseline, fail the build when it drifts.\n- **Environment-aware baselines**. Saved runs record git commit + machine info and warn on cross-machine comparisons.\n- **Warmup** support. Cold starts stay out of your measurement window.\n\n## Install\n\n```bash\nuv add --dev pytest-fastprom\n# or\npip install pytest-fastprom\n```\n\n## Docs\n\nFull guide, marker reference, and regression detection: \u003Chttps:\u002F\u002Flujeni.github.io\u002Fpytest-fastprom\u002F>.\n","pytest-fastprom 是一个将服务级别目标（SLOs）转化为 pytest 断言的工具。它基于 Prometheus 指标，支持对 FastAPI 应用进行性能测试，确保应用满足预设的延迟和错误预算。该项目利用真实的应用指标而非简单的计时器来执行断言，并提供隔离的注册表以防止测试间的度量泄漏。此外，它还支持自定义指标检查、错误率控制以及回归检测等功能，使得开发者能够更精确地衡量与监控其应用在不同环境下的表现。适用于需要严格控制服务响应时间和可靠性指标的场景，如微服务架构下的性能测试或持续集成\u002F持续部署（CI\u002FCD）流程中的自动化测试环节。",2,"2026-06-11 04:02:58","CREATED_QUERY"]