Rewrite test_doctests to avoid running tests twice
Remove commented line
Actually this test passes
Do not report redefinition of import in a local scope if the global name is used elsewhere in the module; fixes lp:1297161
Refactor method handleDoctests
Catch undefined var in loop generator when used as loop var; fixes lp:1205907