Skip to content

Commit e8cd564

Browse files
committed
Use bpython._py3compat
Also rename self.foo to something more meaningful.
1 parent b2111bd commit e8cd564

File tree

1 file changed

+10
-4
lines changed

1 file changed

+10
-4
lines changed

bpython/test/test_import_not_cyclical.py

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,15 @@
1+
# encoding: utf-8
2+
3+
import os
4+
import sys
5+
import tempfile
6+
7+
from bpython._py3compat import py3
18
from bpython.test import unittest
29
from bpython.importcompletion import find_modules
3-
import os, sys, tempfile
410

511

6-
@unittest.skipIf(sys.version_info[0] <= 2, "Test doesn't work in python 2.")
12+
@unittest.skipIf(not py3, "Test doesn't work in python 2.")
713
class TestAvoidSymbolicLinks(unittest.TestCase):
814
def setUp(self):
915
with tempfile.TemporaryDirectory() as import_test_folder:
@@ -61,7 +67,7 @@ def setUp(self):
6167
True,
6268
)
6369

64-
self.foo = list(find_modules(os.path.abspath(import_test_folder)))
70+
self.modules = list(find_modules(os.path.abspath(import_test_folder)))
6571
self.filepaths = [
6672
"Left.toRight.toLeft",
6773
"Left.toRight",
@@ -76,7 +82,7 @@ def setUp(self):
7682
]
7783

7884
def test_simple_symbolic_link_loop(self):
79-
for thing in self.foo:
85+
for thing in self.modules:
8086
self.assertTrue(thing in self.filepaths)
8187
if thing == "Left.toRight.toLeft":
8288
self.filepaths.remove("Right.toLeft")

0 commit comments

Comments
 (0)