@contextmanager
def compat_assert_produces_warning(w):
 if compat.PY3:
  (yield)
 else:
  with tm.assert_produces_warning(expected_warning=w, check_stacklevel=False):
   (yield)

@ contextmanager def compat_assert_produces_warning ( w ) : if compat . PY3 : ( yield ) else : with tm . assert_produces_warning ( expected_warning = w , check_stacklevel = False ) : ( yield )
dont produce a warning under py3 .