How do I do a doctest that requires sending an escaped quotation mark in the parameters? Like this: parameter: '"custom instructions" in Siri' Tired: >>> slugify("'\"custom instructions\" in Siri'", args) But I get a syntax error.
6 steps completed
To write a doctest that requires sending an escaped quotation mark in the parameters, you can use double quotes to enclose the string and single quotes inside the string, or vice versa. In your case, you can modify the doctest like this:
Here, the outer double quotes enclose the string, and the inner double quotes are part of the string itself. This should resolve the syntax error you encountered.
How to escape quotation marks in Python doctests
Can I use double quotes in Python doctests
How to pass a string with quotes as a parameter in Python doctests