Skip to content

Commit 9623fe6

Browse files
committed
Support oldstyle filtering
1 parent fa18381 commit 9623fe6

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

test/framework/suite.py

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -118,15 +118,15 @@
118118

119119
class EasyBuildFrameworkTestSuite(unittest.TestSuite):
120120
def __init__(self, loader):
121-
super(EasyBuildFrameworkTestSuite, self).__init__([x.suite(loader) for x in tests])
121+
super().__init__([x.suite(loader) for x in tests])
122122

123123
def run(self, *args, **kwargs):
124124
# initialize logger for all the unit tests
125125
fd, log_fn = tempfile.mkstemp(prefix='easybuild-tests-', suffix='.log')
126126
os.close(fd)
127127
os.remove(log_fn)
128128
fancylogger.logToFile(log_fn)
129-
res = super(EasyBuildFrameworkTestSuite, self).run(*args, **kwargs)
129+
res = super().run(*args, **kwargs)
130130
fancylogger.logToFile(log_fn, enable=False)
131131
if not res.wasSuccessful():
132132
sys.stderr.write("ERROR: Not all tests were successful.\n")
@@ -142,4 +142,7 @@ def load_tests(loader, tests, pattern):
142142

143143

144144
if __name__ == '__main__':
145-
unittest.main()
145+
if len(sys.argv) > 1 and sys.argv[1].startswith('-'):
146+
unittest.main()
147+
else:
148+
unittest.TextTestRunner().run(EasyBuildFrameworkTestSuite(None))

0 commit comments

Comments
 (0)