A few thoughts:

 * The tests are never run in any sort of parallel/multithreaded environment, so there's unlikely to be a problem on that front.
 * Most of the env stuff is harmless enough, but modifying anything in `os` is more worrisome.
 * There's definitely a cleaner way to handle this in python, though I'm not sure how much you want to do. The "right" answer here is to write a [context manager](https://docs.python.org/2/library/contextlib.html); roughly speaking, you'd write something that looks like (where you're welcome to change the names):

        @contextlib.contextmanager
        def SetupEnv(desired_os, desired_server_software):
          original_server_software = os.environ.get('SERVER_SOFTWARE')
          os.environ['SERVER_SOFTWARE'] = desired_server_software
          ... <more env setup> ...
          yield
          os.environ['SERVER_SOFTWARE'] = original_server_software
          ... <more resetting> ...

  Then you can just say

      with SetupEnv('nt', 'DEV_APPSERVER'):
        ... <tests for that env> ...