Issue
I am getting a line too long PEP 8 E501 issue.
f'Leave Request created successfully. Approvers sent the request for approval: {leave_approver_list}'
I tried using a multi-line string, but that brings in a \n
, which breaks my test:
f'''Leave Request created successfully.
Approvers sent the request for approval: {leave_approver_list}'''
How can I keep it single line and pass PEP 8 linting?
Solution
Use parentheses and string literal concatenation:
msg = (
f'Leave Request created successfully. '
f'Approvers sent the request for approval: {leave_approver_list}'
)
Note, the first literal doesn't need an f
, but I include it for consistency/readability.
Answered By - juanpa.arrivillaga
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.