How do I test dictionary-equality with Python's doctest-package?

前端 未结 7 1470
眼角桃花
眼角桃花 2020-12-09 07:15

I\'m writing a doctest for a function that outputs a dictionary. The doctest looks like

>>> my_function()
{\'this\': \'is\', \'a\': \'dictionary\'}
         


        
相关标签:
7条回答
  • 2020-12-09 08:14

    Most of it has been already said here.. anyway JSYK: there is a dedicated section in doctest documentation:

    https://docs.python.org/3.5/library/doctest.html#warnings

    0 讨论(0)
提交回复
热议问题