Skip to main content

pytest-picker

勾选 pytest 测试用例 + Allure 选项,实时生成可执行命令的 Web 工具。

在目标项目的测试用例目录树上打勾,自动生成 pytest 执行命令、pytest.main() 代码和 Allure 报告命令,一键复制即可使用——全程零侵入,不修改目标项目的任何文件。

功能特性

  • 零侵入收集:通过子进程调用 pytest --collect-only,注入收集插件,不改动目标项目的代码与配置
  • 用例目录树:按目录/文件分组展示所有用例,勾选框支持级联与三态(半选),参数化用例 ID 完整显示
  • 搜索过滤:按用例名 / 文件路径 / 目录名实时过滤,目录命中时展示整个子树
  • Marker 与参数:自动识别目标项目的自定义 marker、conftest 自定义参数和已安装插件的参数,可勾选加入命令
  • Allure 集成:--alluredir、--clean-alluredir、--lang zh 等选项可视化配置,同步生成 allure generate 与 allure open 命令
  • 命令生成:pytest 执行命令 / pytest.main() 代码 / Allure 报告命令集中展示,各带复制按钮;用例以列表传参,路径含空格也能正确执行

快速开始

无需安装,一条命令直接运行(推荐):

uvx pytest-picker          # 或 pipx run pytest-picker

或安装后使用:

pip install pytest-picker
pk run

启动后自动打开浏览器访问 Web 界面(端口由系统自动分配,也可 --port 指定):

pk run c:\path\to\your\project   # 指定默认打开的目标项目路径
pk run --port 5000               # 固定端口
pk run --no-browser              # 不自动打开浏览器

使用流程

  1. 在输入框填入目标项目路径(或测试目录),点击收集
  2. 在用例树上勾选要执行的用例,按需勾选 marker、自定义参数、Allure 与 pytest 选项
  3. 复制页面底部生成的命令,到目标项目目录下执行

工作原理

  • 后端以子进程列表传参方式执行 python -m pytest --collect-only -q -p pytest_picker.plugin,通过 PYTHONPATH 注入收集插件,目标项目无需安装本工具
  • 插件基于 pytest_collection_finish 钩子,将收集到的用例按文件分组写入 tests.json(输出到系统临时目录)
  • 前端从 tests.json 构建目录树,勾选结果实时生成命令

环境要求

  • Python >= 3.8
  • 目标项目可正常运行 pytest

License

MIT

Metadata

Release files for pytest-picker 0.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for pytest-picker 0.1.0
File Size Uploaded Provenance Actions
pytest_picker-0.1.0.tar.gz 50.6 kB Without provenance Details for pytest_picker-0.1.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for pytest-picker 0.1.0
File Interpreter ABI Platform Actions
pytest_picker-0.1.0-py3-none-any.whl Python 3 none any Details for pytest_picker-0.1.0-py3-none-any.whl

Total release size: 67.2 kB

Release files / pytest_picker-0.1.0.tar.gz

Download URL pytest_picker-0.1.0.tar.gz
Size 50.6 kB
Tags Source
SHA-256 checksum
How to use checksums
9c4ca0ea68aa34656cc55964a9caf6d62904a641267f59f68c35889d9d35e013
BLAKE2b-256 checksum
How to use checksums
e90dd74130a4e2f0023ff84b6231e19e5505752ec744edab62a4c223d1e001e4
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.11.21 {"installer":{"name":"uv","version":"0.11.21","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":null,"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

Release files / pytest_picker-0.1.0-py3-none-any.whl

Download URL pytest_picker-0.1.0-py3-none-any.whl
Size 16.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
1b17c32ea8cffca9d5b87d08fff9e99c7170a03ccbb8fbde2db2acd4f8adef37
BLAKE2b-256 checksum
How to use checksums
e0a51b94cccd5f95b28580dcca90ee89c4d9a2dc03e012a753c33504cb89bf03
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.11.21 {"installer":{"name":"uv","version":"0.11.21","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":null,"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

Security for pytest-picker 0.1.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page