class_docstr: Test that the individual asserts honour longMessage.
  This actually tests all the message behaviour for
  asserts that use longMessage.
class_docstr_tok: ["Test","that","the","individual","asserts","honour","longMessage",".","This","actually","tests","all","the","message","behaviour","for","asserts","that","use","longMessage","."]
code: def testAssertWarnsRegex(self):
      # test error not raised
      self.assertMessagesCM(
          "assertWarnsRegex",
          (UserWarning, "unused regex"),
          lambda: None,
          [
              "^UserWarning not triggered$",
              "^oops$",
              "^UserWarning not triggered$",
              "^UserWarning not triggered : oops$",
          ],
      )
  
      # test warning raised but with wrong message
      def raise_wrong_message():
          warnings.warn("foo")
  
      self.assertMessagesCM(
          "assertWarnsRegex",
          (UserWarning, "regex"),
          raise_wrong_message,
          [
              '^"regex" does not match "foo"$',
              "^oops$",
              '^"regex" does not match "foo"$',
              '^"regex" does not match "foo" : oops$',
          ],
      )
  
imports: import datetime
  import warnings
  import weakref
  import unittest
  from test.support import gc_collect
  from itertools import product
label_desc: Use image node_id 32 for calling the TestLongMessage obj's underlying member method code with example usage: obj.testAssertWarnsRegex() without return types