Skip to content

Commit b792313

Browse files
committed
Fix test_message_policy: move test body out of gen_policy()
The policy test code was accidentally indented inside gen_policy() after the return statement, making it unreachable.
1 parent 7137186 commit b792313

1 file changed

Lines changed: 12 additions & 12 deletions

File tree

emails/testsuite/message/test_message.py

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -161,18 +161,18 @@ def gen_policy(**kw):
161161
import email.policy
162162
return email.policy.SMTP.clone(**kw)
163163

164-
# Generate without policy
165-
m1 = emails.Message(**common_email_data())
166-
m1.policy = None
167-
# Just generate without policy
168-
m1.as_string()
169-
170-
# Generate with policy
171-
m1 = emails.Message(**common_email_data())
172-
m1.policy = gen_policy(max_line_length=60)
173-
# WTF: This check fails.
174-
# assert max([len(l) for l in m1.as_string().split(b'\n')]) <= 60
175-
# TODO: another policy checks
164+
# Generate without policy
165+
m1 = emails.Message(**common_email_data())
166+
m1.policy = None
167+
# Just generate without policy
168+
m1.as_string()
169+
170+
# Generate with policy
171+
m1 = emails.Message(**common_email_data())
172+
m1.policy = gen_policy(max_line_length=60)
173+
# WTF: This check fails.
174+
# assert max([len(l) for l in m1.as_string().split(b'\n')]) <= 60
175+
# TODO: another policy checks
176176

177177

178178
def test_message_id():

0 commit comments

Comments
 (0)