I have a unit test that I\'d like to write for a function that takes XML as a string. It\'s a doctest and I\'d like the XML in-line with the tests. Since the XML is multi-line
This code works, e.g. with Python 2.7.12 and 3.5.2:
def test(): """ >>> config = ''' ... ... d1 ... d2 ... ''' >>> print(config) d1 d2 """ if __name__ == "__main__": import doctest doctest.testmod(name='test')