def test_domain_lookup():
	try:
		import DNS
	except __HOLE__:
		pytest.skip("PyDNS not installed.")

	mock = DomainValidator()
	dataset = [
			('gothcandy.com', 'a', '174.129.236.35'),
			('a' * 64 + '.gothcandy.com', 'a', False),
			('gothcandy.com', 'mx', [(10, 'mx1.emailsrvr.com'), (20, 'mx2.emailsrvr.com')]),
			('nx.example.com', 'a', False),
			('xn--ls8h.la', 'a', '38.103.165.13'),  # IDN: (poop).la
		]

	def closure(domain, kind, expect):
		try:
			assert mock.lookup_domain(domain, kind, server=['8.8.8.8']) == expect
		except DNS.DNSError:
			pytest.skip("Skipped due to DNS error.")

	for domain, kind, expect in dataset:
		yield closure, domain, kind, expect
dataset/ETHPy150Open marrow/mailer/test/test_validator.py/test_domain_lookup