更新时间:2023-02-18 19:23:35
您可以设置 ALLOW_UNICODE
标志(全局或每个测试),请参阅 pytest 文档 了解详情.
You can set the ALLOW_UNICODE
flag (either globally or per test), see the pytest docs for details.
示例:
[pytest]
doctest_optionflags = ALLOW_UNICODE
或
# content of example.rst
>>> get_unicode_greeting() # doctest: +ALLOW_UNICODE
'Hello'