fix bugs in test running and setup.py
udpate gitignore