From cdab7910d780bab596e2daaadd01f3162b5ee652 Mon Sep 17 00:00:00 2001 From: Stephen Finucane Date: Sun, 8 Sep 2019 16:03:17 +0100 Subject: [PATCH] travis: Resolve issues with Python 3.7 Bump the distro version to xenial, as this is the first version to include Python 3.7 support. Bionic is also available but it doesn't support Python 3.5 [1]. In addition, skip a test that was valid on Python 3.4 - 3.6 but does not appear to be an issue for Python 3.7. [1] https://docs.travis-ci.com/user/reference/bionic/#python-support Signed-off-by: Stephen Finucane Fixes: 6267a5fa ("Drop support for Python 3.4, add Python 3.7") --- .travis.yml | 2 +- patchwork/tests/test_parser.py | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/.travis.yml b/.travis.yml index 77d60c12..d3f6d702 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,6 +1,6 @@ language: python -dist: trusty +dist: xenial sudo: false python: diff --git a/patchwork/tests/test_parser.py b/patchwork/tests/test_parser.py index c8f8bd9f..e5a2fca3 100644 --- a/patchwork/tests/test_parser.py +++ b/patchwork/tests/test_parser.py @@ -9,6 +9,7 @@ from email.mime.multipart import MIMEMultipart from email.mime.text import MIMEText from email.utils import make_msgid import os +import sys import unittest from django.test import TestCase @@ -981,7 +982,8 @@ class WeirdMailTest(TransactionTestCase): except ValueError: pass - @unittest.skipIf(six.PY2, 'Breaks only on Python 3') + @unittest.skipUnless((3, 0) <= sys.version_info < (3, 7), + 'Breaks only on Python 3.0 - 3.6') def test_early_fail(self): file_path = os.path.join(TEST_FUZZ_DIR, 'earlyfail.mbox') with self.assertRaises(AttributeError): -- 2.47.3