Our deploy/configuration system includes credentials for connecting to a database. We have one production database, and a variety of clones of that in our test and development environments.
We've got a large body of tests, written with a combination of unittest and nose. Many of our tests do things which shouldn't be done against the production database. I'd like to set things up so anytime any test code gets run, a check is made to see which database you're connected to and if you're connect to production, the test refuses to run. It's easy to write a check like that in setup(), but that only gets called if you remember to write a setup() method (or inherit from something that does). I'm looking for something that runs completely automatically. I don't want somebody to be able to write something which causes damage that nose can discover and run when you're connected to the wrong database. -- http://mail.python.org/mailman/listinfo/python-list