File tree 1 file changed +10
-4
lines changed
1 file changed +10
-4
lines changed Original file line number Diff line number Diff line change
1
+ # encoding: utf-8
2
+
3
+ import os
4
+ import sys
5
+ import tempfile
6
+
7
+ from bpython ._py3compat import py3
1
8
from bpython .test import unittest
2
9
from bpython .importcompletion import find_modules
3
- import os , sys , tempfile
4
10
5
11
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." )
7
13
class TestAvoidSymbolicLinks (unittest .TestCase ):
8
14
def setUp (self ):
9
15
with tempfile .TemporaryDirectory () as import_test_folder :
@@ -61,7 +67,7 @@ def setUp(self):
61
67
True ,
62
68
)
63
69
64
- self .foo = list (find_modules (os .path .abspath (import_test_folder )))
70
+ self .modules = list (find_modules (os .path .abspath (import_test_folder )))
65
71
self .filepaths = [
66
72
"Left.toRight.toLeft" ,
67
73
"Left.toRight" ,
@@ -76,7 +82,7 @@ def setUp(self):
76
82
]
77
83
78
84
def test_simple_symbolic_link_loop (self ):
79
- for thing in self .foo :
85
+ for thing in self .modules :
80
86
self .assertTrue (thing in self .filepaths )
81
87
if thing == "Left.toRight.toLeft" :
82
88
self .filepaths .remove ("Right.toLeft" )
You can’t perform that action at this time.
0 commit comments