Docker-compose exit code , build passes

I am running a py.test suite using docker-compose up. When tests, fail the container clearly exits with exit code 1 and yet the build passes.