File tree Expand file tree Collapse file tree 1 file changed +8
-3
lines changed
graalpython/com.oracle.graal.python.test/src Expand file tree Collapse file tree 1 file changed +8
-3
lines changed Original file line number Diff line number Diff line change @@ -577,10 +577,12 @@ def run(cls, items=None):
577
577
return instance
578
578
for k , v in items :
579
579
if k .startswith ("test" ):
580
+ testfn = getattr (instance , k , v )
580
581
if patterns :
581
- if not any (p in k for p in patterns ):
582
+ import fnmatch
583
+ if not any (fnmatch .fnmatch (testfn .__qualname__ , p ) for p in patterns ):
582
584
continue
583
- instance .run_test (getattr ( instance , k , v ) )
585
+ instance .run_test (testfn )
584
586
if hasattr (instance , "tearDownClass" ):
585
587
instance .run_safely (instance .tearDownClass )
586
588
return instance
@@ -752,7 +754,10 @@ class TextTestResult():
752
754
if argv [idx ] == "-k" :
753
755
argv .pop (idx )
754
756
try :
755
- patterns .append (argv .pop (idx ))
757
+ pattern = argv .pop (idx )
758
+ if '*' not in pattern :
759
+ pattern = '*' + pattern + '*'
760
+ patterns .append (pattern )
756
761
except IndexError :
757
762
print ("-k needs an argument" )
758
763
else :
You can’t perform that action at this time.
0 commit comments