Consider if there is a way to break up or simplify this conditional block as it is long and nested very deep.  Normally 3-levels of <code>if</code>'s is about all my old-brain can handle :)  Separate <code>if</code> blocks or boolean-functions can help, but relying on exceptions is an even better strategy:  Any exception not caught will result in test failure.  You can exploit this and still ensure proper clean-up with the <code>try...finally</code> form.  In general, it's more important that we know "something" went wrong, than know exactly what the problem was.

One idea is to maybe make "handler" functions for each different kind of options you need to check.  Each function can return True/False for good/bad result.  Pack the correct functions into a list, then run each item in the list and count if any return False.

The point is to make maintaining the test easy.  e.g. if we need to add a new option check, it's a pain to have to try and understand a big block of <code>if</code> statement.  Much easier to just make a new function or class or similar.

Make sense?