pythonassertwing-ide

In WingIDE, how do I ignore exceptions at specific locations when "Always Report" is activated?


I want to 'always' break on AssertionError, except for certain locations. E.g. ..site-packages/_pytest/config/__init__.py an exception is thrown just to check whether assertions are activated:

def _assertion_supported():
  try:
    assert False
  except AssertionError:
    return True
  else:
    return False

Is there a way to say "always break on AssertionError except for those locations"?


Solution

  • If you have AssertionError in the Debugger > Exceptions > Always Report preference then upon reaching an assertion you can check the "Ignore this exception location" in the Exceptions tool and continue debugging. That assertion should not be reported again, but others will be.

    Of course if the assertion isn't handled by a try/except then it may still terminate your debug process, same as it would when run outside the debugger.