def test_report_can_deal_with_single_anonymous_result_not_with_more():
report = WorstReport()
report.handle_results_collected(
signal=None, sender=WithId('foo'),
results=[9], context={})
assert list(report.data.keys()) == ['foo']
assert get_value_and_context(report, 'foo')[0] == 9
with pytest.raises(TypeError) as excinfo:
report.handle_results_collected(
signal=None, sender=WithId('foo'),
results=[1, 2], context={})
assert 'Duplicate result name(s): \'\'' == str(excinfo.value)
assert list(report.data.keys()) == ['foo']
assert get_value_and_context(report, 'foo')[0] == 9
test_worst_report.py 文件源码
python
阅读 23
收藏 0
点赞 0
评论 0
评论列表
文章目录