def get_safe_settings(settings_module):
    """
    setup.py test and the multiprocessing module tend
    to fight. Since lettuce.django uses the multiprocessing
    module we do not want to include that when running unit tests with
    setup.py test because it causes an error every time, even though
    the tests run fine.

    Here is the exception that will occur after the tests finish.

    Traceback (most recent call last):
      File "/usr/lib/python2.7/atexit.py", line 24, in _run_exitfuncs
        func(*targs, **kargs)
      File "/usr/lib/python2.7/multiprocessing/util.py", line 284, in _exit_function
        info('process shutting down')
    TypeError: 'NoneType' object is not callable

    For more details see:
        http://comments.gmane.org/gmane.comp.python.distutils.devel/11688
    """

    installed_apps = list(settings_module.INSTALLED_APPS)
    if 'lettuce.django' in installed_apps:
        installed_apps.pop(installed_apps.index('lettuce.django'))
        settings_module.INSTALLED_APPS = installed_apps
    return settings_module