本文整理汇总了Python中hypothesis.Verbosity.verbose方法的典型用法代码示例。如果您正苦于以下问题:Python Verbosity.verbose方法的具体用法?Python Verbosity.verbose怎么用?Python Verbosity.verbose使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类hypothesis.Verbosity
的用法示例。
在下文中一共展示了Verbosity.verbose方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_group_random_extra
# 需要导入模块: from hypothesis import Verbosity [as 别名]
# 或者: from hypothesis.Verbosity import verbose [as 别名]
def test_group_random_extra():
"""Testing the random type of grouping with a group of extra people not assigned
to their own group"""
responses = [
["Nick", True, False, True, False],
["Marvin", False, False, True, True],
["Evin", True, True, True, False],
["Nikki", True, True, False, False],
["Dan", False, True, False, True],
]
num_group = 2
returned_groups1 = group_creation.group_random_num_group(responses, num_group)
assert len(returned_groups1) == 2
assert num_group == 2
# Test uses now deleted group_size dependent functions, must be rewritten or deleted
# @given(grpsize=integers(min_value=1, max_value=3))
# @settings(verbosity=Verbosity.verbose)
# @pytest.mark.hypothesisworks
# def test_group_random2(grpsize):
# """This hypothesis test will test the group_random_group_size method"""
# responses = [
# ["Nick", True, False, True, False],
# ["Marvin", False, False, True, True],
# ["Evin", True, True, True, False],
# ["Nikki", True, True, False, False],
# ["Nick", True, False, True, False],
# ["Dan", False, True, False, True],
# ]
# returned_groups = group_creation.group_random_group_size(responses, grpsize)
# size_count = grpsize
# assert len(returned_groups[0]) == size_count
示例2: test_group_random1
# 需要导入模块: from hypothesis import Verbosity [as 别名]
# 或者: from hypothesis.Verbosity import verbose [as 别名]
def test_group_random1():
"""Testing that the group_random() function creates the
appropriate number of groups with the appropriate number"""
lst = [
"Austin",
"Dan",
"Angie",
"Cullen",
"Chase",
"Vinny",
"Nick",
"Jeff",
"James",
"Kelly",
"Nikki",
"Robert",
]
lst2 = ["Dan", "Angie", "Austin", "Izaak", "Nick", "Jeff"]
num_group = 2
num_group2 = 3
actual_output3 = group_creation.group_random_num_group(lst, num_group)
actual_output4 = group_creation.group_random_num_group(lst2, num_group2)
assert len(actual_output3) == 2
assert len(actual_output3[0]) == 6
assert len(actual_output4) == 3
assert len(actual_output4[0]) == 2
# Test uses now deleted group_size dependent functions, must be rewritten
# @given(group_size=integers(min_value=1, max_value=3))
# @settings(verbosity=Verbosity.verbose, deadline=None)
# @pytest.mark.hypothesisworks
# def hypothesis_test_group_random1(group_size):
# """this hypothesis test can generate the group numbers and test if it pass
# the requirements"""
# lst = [
# "Austin",
# "Dan",
# "Angie",
# "Cullen",
# "Chase",
# "Vinny",
# "Nick",
# "Jeff",
# "James",
# "Kelly",
# "Nikki",
# "Robert",
# ]
# lst2 = ["Dan", "Angie", "Austin", "Izaak", "Nick", "Jeff"]
# size_count = group_size
# actual_output = group_creation.group_random_group_size(lst, group_size)
# actual_output2 = group_creation.group_random_group_size(lst2, group_size)
#
# assert len(actual_output) == 12 // size_count
# assert len(actual_output[0]) == size_count
# assert len(actual_output2) == 6 // size_count
# assert len(actual_output2[0]) == size_count
示例3: test_shuffle
# 需要导入模块: from hypothesis import Verbosity [as 别名]
# 或者: from hypothesis.Verbosity import verbose [as 别名]
def test_shuffle():
"""Checking the shuffle_students method for appropriate ouput"""
student_identifiers = [
"Dan",
"Nikki",
"Nick",
"Jeff",
"Austin",
"Simon",
"Jesse",
"Maria",
]
shuffled_students = group_creation.shuffle_students(student_identifiers)
for i in range(0, len(shuffled_students)):
assert student_identifiers[i] in shuffled_students
assert student_identifiers != shuffled_students
# Test uses now deleted group_size dependent functions, must be rewritten or deleted
# @given(grpsize=integers(min_value=2, max_value=3))
# @settings(verbosity=Verbosity.verbose)
# @pytest.mark.hypothesisworks
# def test_hypothesis_round_robin(grpsize):
# """Testing the random round robin with hypothesis if grpsize is greater than
# 3 index becomes out of bounds"""
# lst = [
# ["Dan", True, True, True],
# ["Jesse", True, True, True],
# ["Austin", True, True, True],
# ["Nick", False, False, False],
# ["Nikki", False, False, False],
# ["Maria", False, False, False],
# ["Jeff", False, False, False],
# ["Simon", False, False, False],
# ["Jon", False, False, False],
# ["Angie", False, False, False],
# ["Izaak", False, False, False],
# ["Jacob", False, False, False],
# ]
# expected_output = len(lst) / grpsize
# actual_output = group_creation.group_rrobin_group_size(lst, grpsize)
# assert len(actual_output) == expected_output
# assert len(actual_output[0]) == grpsize
# if grpsize == 2:
# assert actual_output[0][0][1] is False
# assert actual_output[1][0][1] is True
# assert actual_output[2][0][1] is True
# assert actual_output[3][0][1] is False
# if grpsize == 3:
# assert actual_output[0][0][1] is True
# assert actual_output[1][0][1] is True
# assert actual_output[2][0][1] is True
# assert actual_output[3][0][1] is False