def do_perform_test(self, caplog, url, expected): thug = ThugAPI() thug.set_useragent('win7ie90') thug.set_broken_url() thug.log_init(url) thug.run_remote(url) records = [r.message for r in caplog.records] matches = 0 for e in expected: for record in records: if e in record: matches += 1 assert matches >= len(expected)