def test_caplog_bug_workaround_2():
 caplog_handler = None
 for h in logging.getLogger().handlers:
  if isinstance(h, pytest_catchlog.LogCaptureHandler):
   assert (caplog_handler is None)
   caplog_handler = h

def test_caplog_bug_workaround_2 ( ) : caplog_handler = None for h in logging . getLogger ( ) . handlers : if isinstance ( h , pytest_catchlog . LogCaptureHandler ) : assert ( caplog_handler is None ) caplog_handler = h
make sure caplog_bug_workaround works correctly after a skipped test .