File tree Expand file tree Collapse file tree 2 files changed +14
-2
lines changed Expand file tree Collapse file tree 2 files changed +14
-2
lines changed Original file line number Diff line number Diff line change @@ -457,7 +457,7 @@ def global_include(self, pattern):
457457 """
458458 if self .allfiles is None :
459459 self .findall ()
460- match = translate_pattern (os .path .join ('**' , pattern ))
460+ match = translate_pattern (os .path .join ('**' , '*' + pattern ))
461461 found = [f for f in self .allfiles if match .match (f )]
462462 self .extend (found )
463463 return bool (found )
@@ -466,7 +466,7 @@ def global_exclude(self, pattern):
466466 """
467467 Exclude all files anywhere that match the pattern.
468468 """
469- match = translate_pattern (os .path .join ('**' , pattern ))
469+ match = translate_pattern (os .path .join ('**' , '*' + pattern ))
470470 return self ._remove_files (match .match )
471471
472472 def append (self , item ):
Original file line number Diff line number Diff line change @@ -449,6 +449,11 @@ def test_global_include(self):
449449 assert file_list .files == ['a.py' , l ('d/c.py' )]
450450 self .assertWarnings ()
451451
452+ file_list .process_template_line ('global-include .txt' )
453+ file_list .sort ()
454+ assert file_list .files == ['a.py' , 'b.txt' , l ('d/c.py' )]
455+ self .assertNoWarnings ()
456+
452457 def test_global_exclude (self ):
453458 l = make_local_path
454459 # global-exclude
@@ -465,6 +470,13 @@ def test_global_exclude(self):
465470 assert file_list .files == ['b.txt' ]
466471 self .assertWarnings ()
467472
473+ file_list = FileList ()
474+ file_list .files = ['a.py' , 'b.txt' , l ('d/c.pyc' ), 'e.pyo' ]
475+ file_list .process_template_line ('global-exclude .py[co]' )
476+ file_list .sort ()
477+ assert file_list .files == ['a.py' , 'b.txt' ]
478+ self .assertNoWarnings ()
479+
468480 def test_recursive_include (self ):
469481 l = make_local_path
470482 # recursive-include
You can’t perform that action at this time.
0 commit comments