Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 1dd75a6

Browse files
committed
Backport test_nntplib fixes from default.
1 parent 62ba042 commit 1dd75a6

1 file changed

Lines changed: 5 additions & 2 deletions

File tree

Lib/test/test_nntplib.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -177,9 +177,12 @@ def test_article_head_body(self):
177177
self.assertTrue(resp.startswith("220 "), resp)
178178
self.check_article_resp(resp, article, art_num)
179179
# Tolerate running the tests from behind a NNTP virus checker
180+
blacklist = lambda line: line.startswith(b'X-Antivirus')
181+
filtered_head_lines = [line for line in head.lines
182+
if not blacklist(line)]
180183
filtered_lines = [line for line in article.lines
181-
if not line.startswith(b'X-Antivirus')]
182-
self.assertEqual(filtered_lines, head.lines + [b''] + body.lines)
184+
if not blacklist(line)]
185+
self.assertEqual(filtered_lines, filtered_head_lines + [b''] + body.lines)
183186

184187
def test_capabilities(self):
185188
# The server under test implements NNTP version 2 and has a

0 commit comments

Comments
 (0)