Wrapping python doctest results that are longer than 80 characters

前端 未结 2 655
一整个雨季
一整个雨季 2020-12-29 20:29

I\'m trying to keep my source code under the 80 character guideline width that PEP8 recommends, but can\'t figure out how to wrap my doctest which has results longe

2条回答
  •  时光取名叫无心
    2020-12-29 20:42

    As suggested by davitenio and qris, I would recommend using the #doctest: +ELLIPSIS directive, like so.

    >>> from test.test_ppp import MockForm
    >>> form = MockForm(mock_file='no-errors.xlsx')
    >>> form.get_languages(settings_default='English', survey_header=
    ... form.metadata['raw_data']['survey'][0])  #doctest: +ELLIPSIS
    ['Ateso', 'English', 'Luganda', ... 'Runyoro-Rutoro']
    

提交回复
热议问题