小编Mat*_*rth的帖子

使用docstrings列出py.test中的测试

这是一个简单的测试文件:

# test_single.py
def test_addition():
    "Two plus two is still four"
    assert 2 + 2 == 4

def test_addition2():
    "One plus one is still two"
    assert 1 + 1 == 2
Run Code Online (Sandbox Code Playgroud)

py.test中的默认输出就像

$ py.test test_single.py -v
[...]
test_single.py::test_addition PASSED
test_single.py::test_addition2 PASSED
Run Code Online (Sandbox Code Playgroud)

我想拥有

Two plus two is still four PASSED
One plus one is still two PASSED
Run Code Online (Sandbox Code Playgroud)

即使用docstrings作为测试的描述.

我试图在conftest.py文件中使用自定义:

import pytest

@pytest.mark.tryfirst
def pytest_runtest_makereport(item, call, __multicall__):
    # execute all other hooks to obtain the report object
    rep = __multicall__.execute() …
Run Code Online (Sandbox Code Playgroud)

python unit-testing pytest

19
推荐指数
4
解决办法
6389
查看次数

Users.threads.list()中缺少大量线程

我正在使用Users.threads.list方法从我的GMail帐户检索线程,查询"in:sent newer_than:1y".结果的第一页(100个主题)看起来很好,有2014年12月和2015年1月的主题.但是,第二页从2014年6月开始,并且可以追溯到2014年5月等.看起来整个页面的线程都缺失了2014年7月至11月.

我已使用https://developers.google.com/gmail/api/v1/reference/users/threads/list中的页内API测试程序重现了这一点.

在GMail的网络界面中,一切都很好看.

我很确定昨天有效,即我能够检索2014年的所有主题/电子邮件.

gmail-api

5
推荐指数
0
解决办法
447
查看次数

标签 统计

gmail-api ×1

pytest ×1

python ×1

unit-testing ×1