本文整理汇总了Python中tools.tracing_import函数的典型用法代码示例。如果您正苦于以下问题:Python tracing_import函数的具体用法?Python tracing_import怎么用?Python tracing_import使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了tracing_import函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_03_branch_rate
def test_03_branch_rate(self):
with tracing_import('./code/if_true_else', db=self.db) as module:
pass
xml = get_stats_xml(db=self.db, whitelist=[re.compile('.*')], blacklist=[])
tree = etree.XML(xml)
for i in tree.xpath('//class'):
branch_rate = i.xpath("./@branch-rate")[0]
self.assertXMLBranchRate(branch_rate)
示例2: test_01_filename
def test_01_filename(self):
with tracing_import('./code/if_true_else', db=self.db) as module:
pass
xml = get_stats_xml(db=self.db, whitelist=[re.compile('.*')], blacklist=[])
tree = etree.XML(xml)
for i in tree.xpath('//class'):
filename = i.xpath("./@filename")[0]
self.assertResultFileName(filename)
示例3: test_15_if_false_while_some
def test_15_if_false_while_some(self):
with tracing_import('if_false_while_some', db=self.db) as module:
pass
self.assertResultBranchRate(Rate(0, 2))
示例4: test_12_if_true_for_some_ifelse
def test_12_if_true_for_some_ifelse(self):
with tracing_import('if_true_for_some_ifelse', db=self.db) as module:
pass
self.assertResultBranchRate(Rate(2, 3))
示例5: test_45_true_false__function_value_if_value_else
def test_45_true_false__function_value_if_value_else(self):
with tracing_import('function_value_if_value_else', db=self.db) as module:
module.function(True); module.function(False)
self.assertResultBranchRate(Rate(2, 2))
示例6: test_41_for_empty_if_true_if_false_not_nested
def test_41_for_empty_if_true_if_false_not_nested(self):
with tracing_import('for_empty_if_true_if_false_not_nested', db=self.db) as module:
pass
self.assertResultBranchRate(Rate(1, 3))
示例7: test_02_empty_file
def test_02_empty_file(self):
with tracing_import('empty_file', db=self.db) as module:
pass
self.assertResultBranchRate(None)
示例8: test_33_for_some_for_some
def test_33_for_some_for_some(self):
with tracing_import('for_some_for_some', db=self.db) as module:
pass
self.assertResultBranchRate(Rate(2, 2))
示例9: test_14_if_false_while_some
def test_14_if_false_while_some(self):
with tracing_import('if_false_while_some', db=self.db) as module:
pass
self.assertResultLineRate(Rate(1, 4))
示例10: test_13_if_true_for_some_ifelse_for_some
def test_13_if_true_for_some_ifelse_for_some(self):
with tracing_import('if_true_for_some_ifelse_for_some', db=self.db) as module:
pass
self.assertResultLineRate(Rate(3, 5))
示例11: test_10_if_true_if_true_else
def test_10_if_true_if_true_else(self):
with tracing_import('if_true_if_true_else', db=self.db) as module:
pass
self.assertResultLineRate(Rate(3, 4))
示例12: test_08_if_true_if_false
def test_08_if_true_if_false(self):
with tracing_import('if_true_if_false', db=self.db) as module:
pass
self.assertResultLineRate(Rate(2, 5))
示例13: test_43_false_fucntion_value_if_value_else
def test_43_false_fucntion_value_if_value_else(self):
with tracing_import('function_value_if_value_else', db=self.db) as module:
module.function(False)
self.assertResultLineRate(Rate(3, 4))
示例14: test_40_for_empty_if_true_if_false_not_nested
def test_40_for_empty_if_true_if_false_not_nested(self):
with tracing_import('for_empty_if_true_if_false_not_nested', db=self.db) as module:
pass
self.assertResultLineRate(Rate(4, 6))
示例15: test_39_for_empty_break_else
def test_39_for_empty_break_else(self):
with tracing_import('for_empty_break_else', db=self.db) as module:
pass
self.assertResultLineRate(Rate(2, 3))