Child: [ddf08c] (diff)

Download this file

nowarnings.py    13 lines (9 with data), 314 Bytes

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
import warnings
from nose.plugins import Plugin
class NoWarnings(Plugin):
def beforeTest(self, result):
# Suppress warnings during tests to reduce noise
warnings.simplefilter("ignore")
def afterTest(self, result):
# Clear list of warning filters
warnings.resetwarnings()