@@ -92,7 +92,10 @@ def fun(self):
92
92
cmd .extend (["-k" , testpattern ])
93
93
testmod = working_test [0 ].rpartition ("." )[2 ]
94
94
print ("Running test:" , working_test [0 ])
95
- cmd .append (os .path .join (os .path .dirname (test .__file__ ), "%s.py" % testmod ))
95
+ testfile = os .path .join (os .path .dirname (test .__file__ ), "%s.py" % testmod )
96
+ if not os .path .isfile (testfile ):
97
+ testfile = os .path .join (os .path .dirname (test .__file__ ), "%s/__init__.py" % testmod )
98
+ cmd .append (testfile )
96
99
subprocess .check_call (cmd )
97
100
print (working_test [0 ], "was finished." )
98
101
@@ -156,6 +159,8 @@ def parse_unittest_output(output):
156
159
timeout = p .stdout .strip ()
157
160
158
161
testfiles = glob .glob (glob_pattern )
162
+ testfiles += glob .glob (glob_pattern .replace (".py" , "/__init__.py" ))
163
+
159
164
for idx , testfile in enumerate (testfiles ):
160
165
for repeat in range (maxrepeats ):
161
166
# we always do this multiple times, because sometimes the tagging
@@ -164,7 +169,10 @@ def parse_unittest_output(output):
164
169
# use the tags and if it fails in the last run, we assume something
165
170
# sad is happening and delete the tags file to skip the tests
166
171
# entirely
167
- testfile_stem = os .path .splitext (os .path .basename (testfile ))[0 ]
172
+ if testfile .endswith ("__init__.py" ):
173
+ testfile_stem = os .path .basename (os .path .dirname (testfile ))
174
+ else :
175
+ testfile_stem = os .path .splitext (os .path .basename (testfile ))[0 ]
168
176
testmod = "test." + testfile_stem
169
177
cmd = [timeout , "-s" , "9" , "120" ] + executable
170
178
if repeat == 0 :
0 commit comments