# Warnings as errors for all the program
import warnings
warnings.filterwarnings("error")
# Warnings as errors whithin block
import warnings
with warnings.catch_warnings():
warnings.simplefilter("error")
# Code in this block will raise exception for a warning