Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

nosetest deprecation warnings

I am getting deprecation warnings from nosetest for 3rd party modules imported by my code.

Does anybody know how to silence these warnings?

I know of the following flag which works for arbitrary python runs of the same code:

 python -W ignore::DeprecationWarning

But, calling nosetest does not appear to offer me a similar flag to prevent the warnings from appearing within the test reports.

like image 593
codeasone Avatar asked Oct 25 '22 06:10

codeasone


1 Answers

Put

import warnings
warnings.filterwarnings('ignore', category=DeprecationWarning)

at the start of your test script, before you import any problematic libraries.

like image 83
unutbu Avatar answered Nov 03 '22 02:11

unutbu