def test_assertion_message_verbosity(self, pytester: Pytester) -> None:
        """
        Obey verbosity levels when printing the "message" part of assertions, when they are
        non-strings (#6682).
        """
        pytester.makepyfile(
            """
            class LongRepr:

                def __repr__(self):
                    return "A" * 500

            def test_assertion_verbosity():
                assert False, LongRepr()
            """
        )
        # Normal verbosity: assertion message gets abbreviated.
        result = pytester.runpytest()
        assert result.ret == 1
        result.stdout.re_match_lines(
            [r".*AssertionError: A+\.\.\.A+$", ".*assert False"]
        )

        # High-verbosity: do not abbreviate the assertion message.
        result = pytester.runpytest("-vv")
        assert result.ret == 1
        result.stdout.re_match_lines([r".*AssertionError: A+$", ".*assert False"])

        Obey verbosity levels when printing the "message" part of assertions, when they are
        non-strings (#6682).
        
testing/test_assertrewrite.py