summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNick Coghlan <ncoghlan@gmail.com>2012-06-17 11:27:18 (GMT)
committerNick Coghlan <ncoghlan@gmail.com>2012-06-17 11:27:18 (GMT)
commit14d99a14912343061463049e814a15127e79c69e (patch)
tree6d36d4a1a4c76ebb14dcae3240a367999a0daa80
parente6ef4622431d8a79d4dbe1313137e443d4dc7db5 (diff)
downloadcpython-14d99a14912343061463049e814a15127e79c69e.zip
cpython-14d99a14912343061463049e814a15127e79c69e.tar.gz
cpython-14d99a14912343061463049e814a15127e79c69e.tar.bz2
Ignore X-Antivirus headers in test_nntplib
-rw-r--r--Lib/test/test_nntplib.py5
-rw-r--r--Misc/NEWS3
2 files changed, 7 insertions, 1 deletions
diff --git a/Lib/test/test_nntplib.py b/Lib/test/test_nntplib.py
index cc490f1..86827f3 100644
--- a/Lib/test/test_nntplib.py
+++ b/Lib/test/test_nntplib.py
@@ -176,7 +176,10 @@ class NetworkedNNTPTestsMixin:
resp, article = self.server.article(art_num)
self.assertTrue(resp.startswith("220 "), resp)
self.check_article_resp(resp, article, art_num)
- self.assertEqual(article.lines, head.lines + [b''] + body.lines)
+ # Tolerate running the tests from behind a NNTP virus checker
+ filtered_lines = [line for line in article.lines
+ if not line.startswith(b'X-Antivirus')]
+ self.assertEqual(filtered_lines, head.lines + [b''] + body.lines)
def test_capabilities(self):
# The server under test implements NNTP version 2 and has a
diff --git a/Misc/NEWS b/Misc/NEWS
index 53b5966..446688c 100644
--- a/Misc/NEWS
+++ b/Misc/NEWS
@@ -301,6 +301,9 @@ Extension Modules
Tests
-----
+- test_nntplib now tolerates being run from behind NNTP gateways that add
+ "X-Antivirus" headers to articles
+
- Issue #15043: test_gdb is now skipped entirely if gdb security settings
block loading of the gdb hooks