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

	mock = DomainValidator(lookup_dns='mx')
	dataset = [
			('example.com', 'Domain does not seem to exist.'),
			# TODO This domain is always erroring out, please do something
			# ('xn--ls8h.la', ''), # IDN: (poop).la
			('', 'Invalid domain: It cannot be empty.'),
			('-bad.example.com', 'Invalid domain.'),
			('gothcandy.com', ''),
			('a' * 64 + '.gothcandy.com', 'Domain does not seem to exist.'),
			('gothcandy.com', ''),
			('nx.example.com', 'Domain does not seem to exist.'),
		]

	def closure(domain, expect):
		try:
			assert mock.validate_domain(domain) == (domain, expect)
		except DNS.DNSError:
			pytest.skip("Skipped due to DNS error.")

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