#!/usr/bin/env python
# -*- coding: utf-8 -*-

def test():
    import bunch
    import doctest
    doctest.testmod(bunch)

if __name__ == '__main__':
    test()

#!/usr/bin/env python
# -*- coding: utf-8 -*-
import sys

def test():
    import bunch
    import doctest
    returned = doctest.testmod(bunch)
    return returned.failed

if __name__ == '__main__':
    sys.exit(test())

return with nonzero if doctest failures exist