Skip to content

Commit 915dff4

Browse files
committed
flake8 fixes
1 parent a846064 commit 915dff4

File tree

3 files changed

+17
-16
lines changed

3 files changed

+17
-16
lines changed

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ install:
99
.PHONY: lint
1010
lint:
1111
#python setup.py check -rms
12-
flake8 email_validator tests
12+
flake8 --ignore=E501,E126 email_validator tests
1313

1414
.PHONY: test
1515
test:

email_validator/__init__.py

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -136,25 +136,25 @@ def __getitem__(self, key):
136136
"""Tests use this."""
137137
def __eq__(self, other):
138138
if self.email == other.email and self.local_part == other.local_part and self.domain == other.domain \
139-
and self.ascii_email == other.ascii_email and self.ascii_local_part == other.ascii_local_part \
140-
and self.ascii_domain == other.ascii_domain \
141-
and self.smtputf8 == other.smtputf8 \
142-
and repr(sorted(self.mx) if self.mx else self.mx) == repr(sorted(other.mx) if other.mx else other.mx) \
143-
and self.mx_fallback_type == other.mx_fallback_type:
139+
and self.ascii_email == other.ascii_email and self.ascii_local_part == other.ascii_local_part \
140+
and self.ascii_domain == other.ascii_domain \
141+
and self.smtputf8 == other.smtputf8 \
142+
and repr(sorted(self.mx) if self.mx else self.mx) == repr(sorted(other.mx) if other.mx else other.mx) \
143+
and self.mx_fallback_type == other.mx_fallback_type:
144144
return True
145145
return False
146146

147147
"""This helps producing the README."""
148148
def as_constructor(self):
149149
return "ValidatedEmail(" \
150-
+ ",".join("\n {}={}".format(
151-
key,
152-
repr(getattr(self, key)))
153-
for key in ('email', 'local_part', 'domain',
154-
'ascii_email', 'ascii_local_part', 'ascii_domain',
155-
'smtputf8', 'mx', 'mx_fallback_type')
156-
) \
157-
+ ")"
150+
+ ",".join("\n {}={}".format(
151+
key,
152+
repr(getattr(self, key)))
153+
for key in ('email', 'local_part', 'domain',
154+
'ascii_email', 'ascii_local_part', 'ascii_domain',
155+
'smtputf8', 'mx', 'mx_fallback_type')
156+
) \
157+
+ ")"
158158

159159

160160
def validate_email(

tests/test_main.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -269,10 +269,11 @@ def test_deliverability_fails():
269269
with pytest.raises(EmailUndeliverableError, match='The domain name {} does not exist'.format(domain)):
270270
validate_email_deliverability(domain, domain)
271271

272+
272273
def test_deliverability_dns_timeout():
273274
validate_email_deliverability.TEST_CHECK_TIMEOUT = True
274275
response = validate_email_deliverability('gmail.com', 'gmail.com')
275276
assert "mx" not in response
276277
assert response.get("unknown-deliverability") == "timeout"
277-
email = validate_email('test@gmail.com')
278-
del validate_email_deliverability.TEST_CHECK_TIMEOUT
278+
validate_email('test@gmail.com')
279+
del validate_email_deliverability.TEST_CHECK_TIMEOUT

0 commit comments

Comments
 (0)