beets/test/alltests.py
adrian.sampson c5e06b6f73 fixed double-loading of test modules
--HG--
extra : convert_revision : svn%3A41726ec3-264d-0410-9c23-a9f1637257cc/trunk%4070
2008-07-07 05:25:14 +00:00

16 lines
No EOL
418 B
Python
Executable file

#!/usr/bin/env python
import unittest
import os
import re
def suite():
s = unittest.TestSuite()
# get the suite() of every module in this directory begining with test_
for fname in os.listdir('.'):
match = re.match(r'(test_\S+)\.py$', fname)
if match:
s.addTest(__import__(match.group(1)).suite())
return s
if __name__ == '__main__':
unittest.main(defaultTest='suite')