Files
simpeg/tests/examples/test_examples.py
T
2015-11-24 22:09:50 -08:00

23 lines
516 B
Python

import unittest
import sys
from SimPEG import Examples
import numpy as np
def get_test(test):
def func(self):
print '\nTesting %s.run(plotIt=False)\n'%test
getattr(Examples, test).run(plotIt=False)
self.assertTrue(True)
return func
attrs = dict()
tests = [_ for _ in dir(Examples) if not _.startswith('_')]
for test in tests:
attrs['test_'+test] = get_test(test)
TestExamples = type('TestExamples', (unittest.TestCase,), attrs)
if __name__ == '__main__':
unittest.main()