It's not good to catch every exception, what happens if someone tries to abort all testing with ctrl-c exactly in this function?  This test will fail, but test runner will not receive KeyboardInterrupt.  One way to solve this is to specify multiple expected exception classes inside a tuple like this:

     except (ShellError, TimeoutError, AttributeError, TypeError), detail:
          ...