How to run debug in PyCharm until you reach warning?

Viewed 238

I am looping through a list of objects in a python program, and I get a RuntimeWarning from one or more attempts at calling numpy.nanmean(). I would like to inspect the contents of the object that results in the warning being thrown, but I loop through a list > 100 items long, so it's a bit unwieldy to use PyCharm's debug feature to step through each iteration. Is there a way to run the program until a Warning is thrown, at which point I can inspect the offending object?

0 Answers
Related