本文整理汇总了Python中coverage.Coverage._warn方法的典型用法代码示例。如果您正苦于以下问题:Python Coverage._warn方法的具体用法?Python Coverage._warn怎么用?Python Coverage._warn使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类coverage.Coverage
的用法示例。
在下文中一共展示了Coverage._warn方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_does_not_trace_files_outside_inclusion
# 需要导入模块: from coverage import Coverage [as 别名]
# 或者: from coverage.Coverage import _warn [as 别名]
def test_does_not_trace_files_outside_inclusion(tmpdir, branch, timid):
@given(st.booleans())
def test(a):
rnd()
cov = Coverage(
config_file=False, data_file=str(tmpdir.join('.coverage')),
branch=branch, timid=timid, include=[__file__],
)
cov._warn = escalate_warning
cov.start()
test()
cov.stop()
data = cov.get_data()
assert len(list(data.measured_files())) == 1
示例2: test_achieves_full_coverage
# 需要导入模块: from coverage import Coverage [as 别名]
# 或者: from coverage.Coverage import _warn [as 别名]
def test_achieves_full_coverage(tmpdir, branch, timid):
@given(st.booleans(), st.booleans(), st.booleans())
def test(a, b, c):
some_function_to_test(a, b, c)
cov = Coverage(
config_file=False, data_file=str(tmpdir.join('.coverage')),
branch=branch, timid=timid,
)
cov._warn = escalate_warning
cov.start()
test()
cov.stop()
data = cov.get_data()
lines = data.lines(__file__)
for i in hrange(LINE_START + 1, LINE_END + 1):
assert i in lines