def METHOD_NAME(self):
    with ignoreWarning(OtherWarning):
        with assertProducesWarnings(SomeWarning,
                                    messages_patterns=["1", "2", "3"]):
            warnings.warn("other", OtherWarning)
            warnings.warn("log 1 message", SomeWarning)
            warnings.warn("other", OtherWarning)
            warnings.warn("log 2 message", SomeWarning)
            warnings.warn("other", OtherWarning)
            warnings.warn("log 3 message", SomeWarning)
            warnings.warn("other", OtherWarning)