saltstack/salt — pull request #4193 by basepi (2013-03-21 23:31:55+00:00)
Title: Fix some unsafe imports in tests

`mock` was imported in an unsafe manner in both `integration/modules/cmdmod.py` and `unit/modules/postgres_test.py`.

@rca, please keep in mind for future tests that we should never just import modules which are not direct dependencies for salt. Rather, we want to wrap them and skip the tests if that module is not available (as I've done here)

Sorry for so many extra commits -- decorators are evaluated at import-time, and apparently I completely forgot how they work as I tried to fix them. =P

Also, I have not actually tested these tests -- this pull req only makes it so if `mock` isn't installed, these tests are skipped.