I have a class in a different module and I want to show a DeprecationWarning when that class is imported. What will be the right way to do so?
module 1 contains -
class Test:
pass
module 2 contains -
from module1 import Test #this line should show a DeprecationWarning.

