Allow tests to be properly skipped if `mock` is not installed.