New feature: command-line interface

未关闭
#106 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

还没有人认领这个 Issue。

评估

难度
5/5
预计耗时
一周以上
新手友好度
30/100
Issue 类型
功能
描述清晰度
基本清楚
活跃度
停滞
技术栈
python
领域
cli

调研方向

Start by reading the package entry points and existing Hypothesis strategy tests to see how schema-based generation is exposed. The issue proposes two CLI modes: emit unique JSON instances, or run a script and shrink failing examples. Done means both modes accept the described arguments and produce the specified output and failure behavior.

由索引模型根据 Issue 内容生成。

描述

It occurs to me that having a jsonschema and wanting to test something is by no means limited to projects using Python, and we can pretty easily provide a useful tool or two. Specifically:

hypothesis json SCHEMA --num=100 --seed=0: write NUM instances conforming to SCHEMA to standard out, one line each. The schema can be provided inline, or as a filename. We use the obvious translation to a test under the hood, no database, and bump up max_examples so that we can ensure every line is unique.

hypothesis json SCHEMA --num=100 --script=test.sh: write each example to testcase.json, execute ./test.sh testcase.json, shrink to minimal failing example as usual. Key database off the schema itself, but not the test script; NUM is the max_examples setting directly for this one. The classic fuzzer interface.

主要语言
Python
星标
281
派生
35
PR 合并指标
30 天内没有已合并 PR

环境准备

  • 没有 Dockerfile 或 Docker Compose 文件
  • 没有 Pull Request 模板
  • 阅读贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

python-jsonschema/hypothesis-jsonschema 的其他 Issue

查看 python-jsonschema/hypothesis-jsonschema 的全部 Issue

相似的 Issue

更多 Python Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。