Может Python doctest игнорировать некоторые выходные строки?

Я устанавливаю python-opencv, чтобы решить мою проблему в Ubuntu 14.04 sh sudo apt-get install python-opencv

30
задан cjb 21 June 2009 в 17:54
поделиться

1 ответ

With doctest.ELLIPSIS, you can use ... to mean "match any string here". You can set doctest options with a doctest directive, to make it active for just one test case: one example in the online docs is:

>>> print range(20) # doctest:+ELLIPSIS
[0, 1, ..., 18, 19]

If you want a doctest option to be active throughout, you can pass it as the optionflags= argument to whatever doctest functions you use, e.g. doctest.testfile. (You can pass multiple option flags there by using the | operator to bit-or them).

38
ответ дан 27 November 2019 в 23:34
поделиться
Другие вопросы по тегам:

Похожие вопросы: