fix for support python2.6
add py.test for testing