diff options
author | Martin Gracik <mgracik@redhat.com> | 2009-03-24 11:05:40 +0100 |
---|---|---|
committer | Martin Gracik <mgracik@redhat.com> | 2009-03-24 14:41:55 +0100 |
commit | ac83df7815ff3db042875db51a43c107e982ee70 (patch) | |
tree | a8b67d04cf0b00ea92b6fa1d4c162123dc9fa0e3 /tests/__init__.py | |
download | anate-master.tar.gz anate-master.tar.xz anate-master.zip |
Diffstat (limited to 'tests/__init__.py')
-rw-r--r-- | tests/__init__.py | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/tests/__init__.py b/tests/__init__.py new file mode 100644 index 0000000..99ee679 --- /dev/null +++ b/tests/__init__.py @@ -0,0 +1,20 @@ +import os + +def getAvailableSuites(): + root, tests_dir = os.path.split(os.path.dirname(__file__)) + modules = [] + + for root, dirs, files in os.walk(tests_dir): + for filename in files: + if filename.endswith('.py') and filename != '__init__.py': + basename, extension = os.path.splitext(filename) + modules.append(os.path.join(root, basename).replace('/', '.')) + + available_suites = {} + for module in modules: + imported = __import__(module, globals(), locals(), [module], -1) + suite = getattr(imported, 'suite', None) + if callable(suite): + available_suites[module] = suite() + + return available_suites |