def _test_parser_with_nodes(xml): """Build an InterfaceParser for the XML snippet and parse it.""" tmpfile = _create_temp_xml_file(xml) parser = InterfaceParser(tmpfile) root_node = parser.parse_with_nodes() os.unlink(tmpfile) return parser, root_node, tmpfile