title: Doctest for nested docstring
body: <p>Suppose I have following code:</p>
  
  <pre><code>def foo(s):
      """A dummy function foo. For example:
  
  &gt;&gt;&gt; a = '''This is a test string line 1
  This is a test string line 2
  This is a test string line 3'''
  &gt;&gt;&gt; foo(a)
  This is a test string line 1
  This is a test string line 2
  This is a test string line 3
  &gt;&gt;&gt;
      """
      print s
  
  if __name__ == '__main__':
      import doctest
      doctest.testmod()
  </code></pre>
  
  <p>And let's save it as foo.py. When I run:</p>
  
  <pre><code>C:\Python27&gt;python.exe foo.py
  **********************************************************************
  File "foo.py", line 5, in __main__.foo
  Failed example:
      a = '''This is a test string line 1
  Exception raised:
      Traceback (most recent call last):
        File "C:\Python27\lib\doctest.py", line 1254, in __run
          compileflags, 1) in test.globs
        File "&lt;doctest __main__.foo[0]&gt;", line 1
          a = '''This is a test string line 1
                                            ^
      SyntaxError: EOF while scanning triple-quoted string literal
  **********************************************************************
  File "foo.py", line 8, in __main__.foo
  Failed example:
      foo(a)
  Exception raised:
      Traceback (most recent call last):
        File "C:\Python27\lib\doctest.py", line 1254, in __run
          compileflags, 1) in test.globs
        File "&lt;doctest __main__.foo[1]&gt;", line 1, in &lt;module&gt;
          foo(a)
      NameError: name 'a' is not defined
  **********************************************************************
  1 items had failures:
     2 of   2 in __main__.foo
  ***Test Failed*** 2 failures.
  </code></pre>
  
  <p>Have tried indent the docstring (    >>> a = '''...'''. Have checked all indents - 4 spaces for each indent) and changed single quote to double quote (>>> a = """...."""), the errors are different and the doctest just won't go successfully. Currently the only thing work is to join all lines to a extreme long string and separate with '\r\n'.</p>
  
  <p>Do I miss something?</p>