Must be called from within `__enter__()`. Performs some magic to have a
  #ContextSkipped exception be raised the moment the with context is entered.
  The #ContextSkipped must then be handled in `__exit__()` to suppress the
  propagation of the exception.

  > Important: This function does not raise an exception by itself, thus
  > the `__enter__()` method will continue to execute after using this function.

def skip(stackframe=1):
  """
  Must be called from within `__enter__()`. Performs some magic to have a
  #ContextSkipped exception be raised the moment the with context is entered.
  The #ContextSkipped must then be handled in `__exit__()` to suppress the
  propagation of the exception.

  > Important: This function does not raise an exception by itself, thus
  > the `__enter__()` method will continue to execute after using this function.
  """

  def trace(frame, event, args):
    raise ContextSkipped

  sys.settrace(lambda *args, **kwargs: None)
  frame = sys._getframe(stackframe + 1)
  frame.f_trace = trace