示例#1
0
def assert_lines1_data(covdata):
    """Check that `covdata` has the data from LINES1."""
    assert_line_counts(covdata, SUMMARY_1)
    assert_measured_files(covdata, MEASURED_FILES_1)
    assert_count_equal(covdata.lines("a.py"), A_PY_LINES_1)
    assert not covdata.has_arcs()
示例#2
0
def assert_measured_files(covdata, measured):
    """Check that `covdata`'s measured files are `measured`."""
    assert_count_equal(covdata.measured_files(), measured)
示例#3
0
 def assertFiles(self, files):
     """Assert that the files here are `files`, ignoring the usual junk."""
     here = os.listdir(".")
     here = self.clean_files(here, ["*.pyc", "__pycache__", "*$py.class"])
     assert_count_equal(here, files)
示例#4
0
 def test_static_context(self):
     self.make_file("main.py", "a = 1")
     cov = coverage.Coverage(context="gooey")
     self.start_import_stop(cov, "main")
     data = cov.get_data()
     assert_count_equal(data.measured_contexts(), ["gooey"])
示例#5
0
 def assert_context_lines(context, lines):
     data.set_query_context(context)
     assert_count_equal(lines, data.lines(fname))
示例#6
0
 def assert_same_files(self, flist1, flist2):
     """Assert that `flist1` and `flist2` are the same set of file names."""
     flist1_nice = [nice_file(f) for f in flist1]
     flist2_nice = [nice_file(f) for f in flist2]
     assert_count_equal(flist1_nice, flist2_nice)