Hypothesis integration
まだ誰も着手していません。
評価
調査の方向性
まず、参照されている returns/contrib/hypothesis/laws.py を読み、このプロジェクトに既存の typeclass と mypy のチェックと比較してください。提案されている check_typeclass 戦略と、その allow_instances、allow_protocols、allow_unknown オプションを定義し、サポートされているケースでは有効な戻り値の型が生成され、サポートされていないケースでは NotImplementedError が生成されることを確認してください。
索引モデルが issue の本文から書いたものです。
説明
Right now we don't test classes with hypothesis at all.
But, I have a great idea (at least it seems to me like so) of adding a hypothesis plugin, similar to one we have in returns: https://github.com/dry-python/returns/blob/master/returns/contrib/hypothesis/laws.py
What should it do?
check_typeclass(typeclass_instance)will check that for all existing types and protocols some valid return type is produced. For example,@typeclass def some(instance) -> strmust producestrfor allinstance,protocol, and supported types and it must produceNotImplementedErrorfor types that are not supported- Looks like
check_typeclassmust haveallow_instances,allow_protocols,allow_unknownkwboolarguments to configure what types we actually need in a resulting strategy
It would be a nice companion to our mypy check.
@Zac-HD do you like it? Maybe you have any other ideas?
- 主要言語
- Python
- スター
- 730
- フォーク
- 30
- PR マージ指標
- 30日以内にマージされた PR はありません
コントリビューションガイド
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
dry-python/classes のほかの issue
-
難易度 3/5 1〜2日 初心者へのやさしさ 35/100
dry-python/classes#496 ·
-
bug
難易度 2/5 1〜3時間 初心者へのやさしさ 45/100
dry-python/classes#494 ·
-
bug
難易度 2/5 1〜3時間 初心者へのやさしさ 52/100
dry-python/classes#492 · コメント 2 件 ·
-
bug
難易度 3/5 1〜2日 初心者へのやさしさ 35/100
dry-python/classes#481 · コメント 5 件 · リアクション 4 件 ·
-
bug
難易度 2/5 1〜3時間 初心者へのやさしさ 35/100
dry-python/classes#386 ·
dry-python/classes の issue をすべて見る
似ている issue
-
bug
難易度 2/5 1〜3時間 初心者へのやさしさ 90/100
learningequality/ricecooker#747 ·
-
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
BSData/horus-heresy-3rd-edition#3171 ·
-
enhancement
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
-
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
run-llama/llama_index#23199 ·
-
難易度 2/5 1〜3時間 初心者へのやさしさ 84/100
KhronosGroup/glTF-Blender-IO#2769 ·