import types

class A:
    def __init__(self):
        self.bar = 0
        self.test_bar = 1
        self.baz = []
        self.test_baz = {}
    def foo(self):
        print "foo"
    def test_foo(self):
        print "test_foo"
    def boo(self):
        print "boo"
    def test_boo(self):
        print "test_boo"

def call_tests(obj):
    for name in dir(obj):
        if name.startswith("test_"):
            attr = getattr(obj, name)
            if isinstance(attr, types.MethodType):
                attr()

def main():
    call_tests(A())

if __name__ == '__main__':
    main()
