tags:

views:

25

answers:

1

The unit tests for a product that I am taking over have not been kept up with during the products development and they are very broken. I am trying to fix them as an exercise to become familiar with the code. However, the all the deprecation warnings are a PITA as they interfere with the display of the test results.

Is there a way to suppress the warnings when I execute the unit tests?

Thanks!

+1  A: 

You can configure the warnings filter:

warnings.filterwarnings("ignore", "", DeprecationWarning)

or equivalently from the command-line:

python -W 'ignore::DeprecationWarning'

Obviously, proceed with caution.

Matthew Flaschen
Thanks. I was hoping that I would be able to pass the suppression request from the cmd line. I seem to recall the either Joel or Martin mention that???? In any case, thanks. :) -- Edited for clarification.
Eric