quick.py:适用于Python的基于属性的测试库

时间:2021-05-03 15:44:46
【文件属性】:
文件名称:quick.py:适用于Python的基于属性的测试库
文件大小:17KB
文件格式:ZIP
更新时间:2021-05-03 15:44:46
python quickcheck property-based-testing type-annotations Python quick.py Quick.py是受Haskell库QuickCheck启发的Python基于属性的测试库。 QuickCheck的核心思想是,您无需为单元测试枚举预期的输入和输出,而是编写关于函数的属性,这些属性对于所有输入都应为true。 这使您可以编写简洁而强大的测试。 安装 pip install quick.py 例子 基本示例: # example.py from quick . features import QuickCheck qc = QuickCheck ( max_count = 100 ) @ qc . forall ( 'Associative property of addition for integers' ) def prop ( x : int , y : int ): return ( x + y ) == ( y + x ) Test
【文件预览】:
quick.py-master
----Readme.md(3KB)
----.style.yapf(95B)
----.travis.yml(137B)
----requirements_dev.txt(203B)
----setup.py(3KB)
----Makefile(515B)
----todos.md(284B)
----tests()
--------unit_tests()
--------test_core.py(1KB)
--------test_generators.py(252B)
--------__init__.py(1B)
--------spec.py(708B)
--------test_arb.py(1KB)
--------test_simplification.py(257B)
--------tests_spec.py(699B)
----.gitignore(585B)
----quick()
--------shrink.py(3KB)
--------misc.py(423B)
--------generators.py(421B)
--------basic_types.py(936B)
--------__init__.py(115B)
--------core.py(3KB)
--------arbitrary.py(1KB)
--------common.py(16B)
--------features.py(4KB)

网友评论