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

Skip to content

Commit d63071b

Browse files
committed
Make the tests pass under Python 2.1 but only by cheating. Python 2.1
doesn't know about the ansi-x3.4-1968 charset so skip two tests that rely on that (msg_32.txt and msg_33.txt).
1 parent eecdc74 commit d63071b

1 file changed

Lines changed: 12 additions & 0 deletions

File tree

Lib/email/test/test_email.py

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1470,6 +1470,12 @@ def test_rfc2231_charset(self):
14701470
self._idempotent(msg, text)
14711471

14721472
def test_more_rfc2231_parameters(self):
1473+
# BAW: What to do about this. Python 2.1 doesn't know about the
1474+
# charset ansi-x3.4-1968, so this test will fail. Do we teach Python
1475+
# about that charset, and if so, where (maybe Charset.py)? For now,
1476+
# just skip this test if we aren't at least in Python 2.2.
1477+
if sys.hexversion < 0x20200000:
1478+
return
14731479
msg, text = self._msgobj('msg_33.txt')
14741480
self._idempotent(msg, text)
14751481

@@ -2252,6 +2258,12 @@ def test_del_param(self):
22522258
""")
22532259

22542260
def test_rfc2231_get_content_charset(self):
2261+
# BAW: What to do about this. Python 2.1 doesn't know about the
2262+
# charset ansi-x3.4-1968, so this test will fail. Do we teach Python
2263+
# about that charset, and if so, where (maybe Charset.py)? For now,
2264+
# just skip this test if we aren't at least in Python 2.2.
2265+
if sys.hexversion < 0x20200000:
2266+
return
22552267
eq = self.assertEqual
22562268
msg = self._msgobj('msg_32.txt')
22572269
eq(msg.get_content_charset(), 'us-ascii')

0 commit comments

Comments
 (0)