Skip to content

Commit 26c8e87

Browse files
QuLogicedschofield
authored andcommitted
Don't run clearly Py2 tests on Py3.
These are only stage 1 futurizations, which don't guarantee Py3 compatibility, so don't run them.
1 parent 11b5c04 commit 26c8e87

File tree

2 files changed

+6
-4
lines changed

2 files changed

+6
-4
lines changed

future/tests/test_futurize.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313

1414
from future.tests.base import (CodeHandler, unittest, skip26, reformat_code,
1515
order_future_lines)
16+
from future.utils import PY2
1617

1718

1819
class TestLibFuturize(unittest.TestCase):
@@ -682,7 +683,7 @@ def test_xrange(self):
682683
for i in xrange(10):
683684
pass
684685
'''
685-
self.unchanged(code, stages=[1])
686+
self.unchanged(code, stages=[1], run=PY2)
686687

687688
@unittest.expectedFailure
688689
def test_absolute_import_changes(self):
@@ -719,7 +720,7 @@ def test_safe_futurize_imports(self):
719720
HTMLParser.HTMLParser
720721
assert list(ifilterfalse(lambda x: x % 2, [2, 4])) == [2, 4]
721722
"""
722-
self.unchanged(before, stages=[1])
723+
self.unchanged(before, stages=[1], run=PY2)
723724

724725
def test_print(self):
725726
before = """
@@ -837,8 +838,8 @@ def test_stdlib_modules_not_changed(self):
837838
except AttributeError as e:
838839
pass
839840
"""
840-
self.convert_check(before, after, stages=[1])
841-
841+
self.convert_check(before, after, stages=[1], run=PY2)
842+
842843
def test_octal_literals(self):
843844
before = """
844845
mode = 0644

future/tests/test_standard_library.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -240,6 +240,7 @@ def test_itertools_zip_longest(self):
240240
self.assertEqual(list(zip_longest(a, b)),
241241
[(1, 2), (2, 4), (None, 6)])
242242

243+
@unittest.skipIf(utils.PY3, 'generic import tests are for Py2 only')
243244
def test_import_failure_from_module(self):
244245
"""
245246
Tests whether e.g. "import socketserver" succeeds in a module

0 commit comments

Comments
 (0)