Updated test.py so it exits with code 1 when a test fails.