Adding missing import statement for warnings module
modify test cases to use tm.assert_produces_warning