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 :
@@ -636,6 +626,18 @@ def _recurse(self, dirpath):
636
626
ihook .pytest_collect_directory (path = dirpath , parent = self )
637
627
return True
638
628
629
+ if six .PY2 :
630
+
631
+ @staticmethod
632
+ def _visit_filter (f ):
633
+ return f .check (file = 1 ) and not f .strpath .endswith ("*.pyc" )
634
+
635
+ else :
636
+
637
+ @staticmethod
638
+ def _visit_filter (f ):
639
+ return f .check (file = 1 )
640
+
639
641
def _tryconvertpyarg (self , x ):
640
642
"""Convert a dotted module name to path."""
641
643
try :
You can’t perform that action at this time.
0 commit comments