@Test
    public void writesStackTraceInfoIgnoringInlineWrites() {
        // This writer ignores inline writes and puts the comment on the line before.
        MyCustomPythonWriter writer = new MyCustomPythonWriter();
        writer.enableStackTraceComments(true);

        writer.writeWithNoFormatting("Hello 1");
        writer.write("Hello 2");
        writer.indent().write("Hello 3");
        writer.writeInline("Hello 4|");
        writer.writeInline("Hello 5");
        String[] result = writer.toString().split("\n");

        assertThat(result[0], startsWith("# software.amazon.smithy.utils.CodeWriterTest.writesStackTraceInfo"));
        assertThat(result[1], equalTo("Hello 1"));
        assertThat(result[2], startsWith("# software.amazon.smithy.utils.CodeWriterTest.writesStackTraceInfo"));
        assertThat(result[3], equalTo("Hello 2"));
        assertThat(result[4], startsWith("    # software.amazon.smithy.utils.CodeWriterTest.writesStackTraceInfo"));
        assertThat(result[5], equalTo("    Hello 3"));
        assertThat(result[6], equalTo("    Hello 4|Hello 5"));
    }
\n"
                                + " * Foo \"foo!\"\n"
                                + " *\n"
                                + " * \"baz\"!\n"
                                + " * Yap!\n"
                                + " *     This is indented, in flow of parent.\n"
                                + " *     Yap!\n"
                                + " *     Yap?\n"
                                + " *     # Has a prefix\n"
                                + " *     # Yes\n"
                                + "
smithy-utils/src/test/java/software/amazon/smithy/utils/CodeWriterTest.java