NOTE: Indentation of the opening """ is unimportant, although the common practice is to indent them. The indentation inside the triple quotes, however, is significant. Each line of the doc string will be dedented according to the opening """. Indentation beyond the column of the opening """ will therefore be preserved.
However, in testing, when writing steps with docstrings, lines inside the triple backticks (```) or triple quotes (""") are dedented according to the first line.
Examples
The following two steps result in identical docstrings:
And the output should contain:
"""
"id": 42,
"foo": "bar",
"""
And
And the output should contain:
"""
"id": 42,
"foo": "bar",
"""
However, the following results in the second line being indented by two spaces:
And the output should contain:
"""
"id": 42,
"foo": "bar",
"""
I can provide a minimum reproducible example (MRE) if requested.
Summary
According to the documentation:
However, in testing, when writing steps with docstrings, lines inside the triple backticks (```) or triple quotes (""") are dedented according to the first line.
Examples
The following two steps result in identical docstrings:
And
However, the following results in the second line being indented by two spaces:
I can provide a minimum reproducible example (MRE) if requested.