سؤال

I want to run this doctest and check the output:

>>> execfile("scss_converter_1.5.1_v1.py") #doctest: +NORMALIZE_WHITESPACE +DONT_ACCEPT_BLANKLINE
body {

    .boxholder {

        .box {

            .col {

                .something {

                    .something.else {

                    }

                }

                img {

                }

                a {

                    .my.span {

                    }

                }

                ul {

                    .list-item {

                    }

                }

                #some-button {

                }

            }

        }

        .another-box.crazy.very.insane {

        }

    }

}
"""

But when I run the test it says the expected output is:

Expected:
    body {

Any way to make it expect the full string with all the words? A new line usually means the end of the expected output doesn't it so it is tricky.

Cheers

هل كانت مفيدة؟

المحلول

As per the docs, the expected output of a doctest ends at an all-whitespace line or a line starting with >>>. If the whitespace lines are an essential part of the output, you can escape them by replacing all the blank lines with <BLANKLINE>.

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top