def init_testmon_data(config, read_source=True): if not hasattr(config, "testmon_data"): environment = eval_environment(config.getini("environment_expression")) testmon_data = TestmonData(config.rootdir.strpath, environment=environment) if read_source: testmon_data.determine_stable() config.testmon_data = testmon_data
def init_testmon_data(config, read_source=True): if not hasattr(config, "testmon_data"): environment = config.getoption( "environment_expression") or eval_environment( config.getini("environment_expression")) libraries = ", ".join(sorted( str(p) for p in pkg_resources.working_set)) testmon_data = TestmonData(config.rootdir.strpath, environment=environment, libraries=libraries) if read_source: testmon_data.determine_stable() config.testmon_data = testmon_data
def test_collect_garbage(self, tmdata): tmdata.write("test_1", {"test_1.py": encode_lines(["FINGERPRINT1"])}) tmdata.source_tree.cache["test_1.py"] = Module(source_code="") tmdata.source_tree.cache["test_1.py"].mtime = 1100.0 tmdata.source_tree.cache["test_1.py"].checksum = 600 tmdata.source_tree.cache["test_1.py"].fingerprint = "FINGERPRINT2" tmdata.determine_stable() assert set(tmdata.all_nodes) tmdata.sync_db_fs_nodes(retain=set()) tmdata.close_connection() td2 = CoreTestmonData("") td2.determine_stable() assert set(td2.all_nodes) == set()