示例#1
0
def track_it(testdir, func):
    testmon = Testmon(project_dirs=[testdir.tmpdir.strpath],
                      testmon_labels=set())
    testmon_data = TestmonData(testdir.tmpdir.strpath)
    _result, coverage_data = testmon.track_dependencies(func, 'testnode')

    testmon_data.set_dependencies('testnode', coverage_data, testdir.tmpdir.strpath)
    return testmon_data.node_data['testnode']
示例#2
0
def test_write_read_data2(testdir):
    n1_node_data = {'a.py': [1]}
    td = CoreTestmonData(testdir.tmpdir.strpath, 'default')
    td.lastfailed = ['n1']
    td.write_data()
    td.set_dependencies('n1', n1_node_data, )
    td2 = CoreTestmonData(testdir.tmpdir.strpath, 'default')
    td2.read_data()
    assert td2.node_data['n1'] == n1_node_data
示例#3
0
 def test_write_read_data2(self, testdir):
     n1_node_data = {'test_a.py': [1]}
     td = CoreTestmonData(testdir.tmpdir.strpath, 'default')
     td.lastfailed = ['test_a.py::n1']
     td.write_data()
     td.set_dependencies('test_a.py::n1', n1_node_data, {})
     td2 = CoreTestmonData(testdir.tmpdir.strpath, 'default')
     td2.read_data()
     assert td2.node_data['test_a.py::n1'] == n1_node_data
     assert td2.f_tests['test_a.py'] == set(['test_a.py::n1'])