@@ -57,7 +57,7 @@ def working_selectors(tagfile):
57
57
with open (tagfile ) as f :
58
58
return [line .strip () for line in f if line ]
59
59
else :
60
- return []
60
+ return None
61
61
62
62
63
63
def working_tests ():
@@ -95,10 +95,13 @@ def fun():
95
95
re_success = re .compile ("^(test\S+)[^\r \n ]* \.\.\. ok$" , re .MULTILINE )
96
96
kwargs = {"stdout" : subprocess .PIPE , "stderr" : subprocess .PIPE , "text" : True , "check" : False }
97
97
98
- if len (sys .argv ) > 1 :
99
- glob_pattern = sys .argv [1 ]
100
- else :
101
- glob_pattern = os .path .join (os .path .dirname (test .__file__ ), "test_*.py" )
98
+ glob_pattern = os .path .join (os .path .dirname (test .__file__ ), "test_*.py" )
99
+ retag = False
100
+ for arg in sys .argv [1 :]:
101
+ if arg == "--retag" :
102
+ retag = True
103
+ else :
104
+ glob_pattern = sys .argv [1 ]
102
105
103
106
p = subprocess .run (["/usr/bin/which" , "timeout" ], ** kwargs )
104
107
if p .returncode != 0 :
@@ -114,6 +117,11 @@ def fun():
114
117
tagfile = os .path .join (TAGS_DIR , testfile_stem + ".txt" )
115
118
test_selectors = working_selectors (tagfile )
116
119
120
+ if test_selectors is None and not retag :
121
+ # there's no tagfile for this, so it's not working at all (or has
122
+ # not been tried)
123
+ continue
124
+
117
125
print ("[%d/%d] Testing %s" % (idx , len (testfiles ), testmod ))
118
126
cmd += ["unittest" , "-v" ]
119
127
for selector in test_selectors :
0 commit comments