Can python doctest ignore some output lines?

后端 未结 6 1495
灰色年华
灰色年华 2020-12-09 15:16

I\'d like to write a doctest like this:

\"\"\"
>>> print a.string()
          foo : a
          bar : b
         date : 

        
6条回答
  •  有刺的猬
    2020-12-09 15:42

    I found it easier to simply assign the unneeded return values to a variable:

    >>> _ = do_something()
    >>> check_something()
    True
    

提交回复
热议问题