python-precisely:适用于Python的Matcher库

时间:2021-05-07 06:18:57
【文件属性】:
文件名称:python-precisely:适用于Python的Matcher库
文件大小:27KB
文件格式:ZIP
更新时间:2021-05-07 06:18:57
Python 准确地说:适用于Python测试的更好断言 精确地允许您编写精确的断言,以便仅测试您真正感兴趣的行为。这使读者可以更清楚地了解预期的行为是什么,并使测试的脆性降低。 当断言失败时,这还允许生成更好的错误消息。 受启发。 例如,假设我们要确保unique函数从列表中删除重复项。 我们可以这样写一个测试: from precisely import assert_that , contains_exactly def test_unique_removes_duplicates (): result = unique ([ "a" , "a" , "b" , "a" , "b" ]) assert_that ( result , contains_exactly ( "a" , "b" )) 只要result以任何顺序包含"a"和"b" ,但不包含其他项目,则断言将通过。
【文件预览】:
python-precisely-master
----README.rst(8KB)
----test-requirements.txt(44B)
----.github()
--------workflows()
----examples()
--------examples.py(2KB)
----tox.ini(352B)
----LICENSE(1KB)
----setup.cfg(28B)
----setup.py(1KB)
----makefile(613B)
----tests()
--------has_feature_tests.py(1KB)
--------not_tests.py(517B)
--------close_to_tests.py(2KB)
--------results_tests.py(342B)
--------numeric_comparison_tests.py(2KB)
--------mapping_includes_tests.py(1KB)
--------raises_tests.py(1KB)
--------is_mapping_tests.py(1KB)
--------has_attrs_tests.py(2KB)
--------anything_tests.py(390B)
--------is_sequence_tests.py(2KB)
--------contains_string_tests.py(734B)
--------starts_with_tests.py(670B)
--------equal_to_tests.py(521B)
--------assert_that_tests.py(446B)
--------includes_tests.py(2KB)
--------all_elements_tests.py(1KB)
--------contains_exactly_tests.py(3KB)
--------any_of_tests.py(1KB)
--------all_of_tests.py(1KB)
--------has_attr_tests.py(1KB)
--------is_instance_tests.py(497B)
----precisely()
--------mapping_matchers.py(2KB)
--------function_matchers.py(955B)
--------core_matchers.py(2KB)
--------base.py(95B)
--------coercion.py(178B)
--------object_matchers.py(2KB)
--------__init__.py(1KB)
--------comparison_matchers.py(2KB)
--------results.py(830B)
--------hamcrest.py(429B)
--------iterable_matchers.py(6KB)
--------feature_matchers.py(857B)
----.gitignore(47B)

网友评论