class_docstr: Context manager to check for warnings as errors.  Usually used with
  ``assert_raises`` in the with block
  
  Examples
  --------
  >>> with error_warnings():
  ...     try:
  ...         warnings.warn('Message', UserWarning)
  ...     except UserWarning:
  ...         print('I consider myself warned')
  I consider myself warned
class_docstr_tok: ["Context","manager","to","check","for","warnings","as","errors",".","Usually","used","with","``","assert_raises","``","in","the","with","block","Examples","--","--","--","--",">",">",">","with","error_warnings","(",")",":","...","try",":","...","warnings.warn","(","'Message","'",",","UserWarning",")","...","except","UserWarning",":","...","print","(","'","I","consider","myself","warned","'",")","I","consider","myself","warned"]
code: def __enter__(self):
      mgr = super().__enter__()
      warnings.simplefilter(self.filter)
      return mgr
  
imports: from __future__ import annotations
  import os
  import re
  import sys
  import typing
  import unittest
  import warnings
  from contextlib import nullcontext
  from itertools import zip_longest
  import numpy
  import pytest
  from numpy.testing import assert_array_equal
  from .helpers import assert_data_similar, bytesio_filemap, bytesio_round_trip
  from .np_features import memmap_after_ufunc
label_desc: Use image node_id 1 for calling the error_warnings obj's underlying member method code with example usage: obj.__enter__() and returns: mgr