File tree Expand file tree Collapse file tree 1 file changed +13
-11
lines changed Expand file tree Collapse file tree 1 file changed +13
-11
lines changed Original file line number Diff line number Diff line change @@ -550,19 +550,9 @@ def _collect(self, arg):
550
550
if argpath .check (dir = 1 ):
551
551
assert not names , "invalid arg %r" % (arg ,)
552
552
553
- if six .PY2 :
554
-
555
- def filter_ (f ):
556
- return f .check (file = 1 ) and not f .strpath .endswith ("*.pyc" )
557
-
558
- else :
559
-
560
- def filter_ (f ):
561
- return f .check (file = 1 )
562
-
563
553
seen_dirs = set ()
564
554
for path in argpath .visit (
565
- fil = filter_ , rec = self ._recurse , bf = True , sort = True
555
+ fil = self . _visit_filter , rec = self ._recurse , bf = True , sort = True
566
556
):
567
557
dirpath = path .dirpath ()
568
558
if dirpath not in seen_dirs :
@@ -637,6 +627,18 @@ def _recurse(self, dirpath):
637
627
ihook .pytest_collect_directory (path = dirpath , parent = self )
638
628
return True
639
629
630
+ if six .PY2 :
631
+
632
+ @staticmethod
633
+ def _visit_filter (f ):
634
+ return f .check (file = 1 ) and not f .strpath .endswith ("*.pyc" )
635
+
636
+ else :
637
+
638
+ @staticmethod
639
+ def _visit_filter (f ):
640
+ return f .check (file = 1 )
641
+
640
642
def _tryconvertpyarg (self , x ):
641
643
"""Convert a dotted module name to path."""
642
644
try :
You can’t perform that action at this time.
0 commit comments