From 32e7b97fc02aeff6988b881a773a544b5d3a976e Mon Sep 17 00:00:00 2001 From: Deniz Turgut Date: Fri, 16 Sep 2016 10:38:28 -0400 Subject: [PATCH] Fixes an issue in test_testsuite.py that causes errors in python 3.5. Also removes the condition in python 3.3, since it's no longer an issue. --- pelican/tests/test_testsuite.py | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/pelican/tests/test_testsuite.py b/pelican/tests/test_testsuite.py index 5dc92bb1..ac6782e8 100644 --- a/pelican/tests/test_testsuite.py +++ b/pelican/tests/test_testsuite.py @@ -1,16 +1,19 @@ # -*- coding: utf-8 -*- from __future__ import print_function, unicode_literals -import sys import warnings +import six + from pelican.tests.support import unittest class TestSuiteTest(unittest.TestCase): - - @unittest.skipIf(sys.version_info[:2] == (3, 3), - "does not throw an exception on python 3.3") def test_error_on_warning(self): - with self.assertRaises(UserWarning): + if six.PY2: + asserter = self.assertRaises + else: + asserter = self.assertWarns + + with asserter(UserWarning): warnings.warn('test warning')