Raise exceptions on all warnings and errors in tests

This commit is contained in:
Chih-Hsuan Yen 2019-03-07 16:25:54 +08:00
parent 5437100f08
commit ab1ecc231d
No known key found for this signature in database
GPG Key ID: 0453A6CA23C56315
2 changed files with 2 additions and 2 deletions

View File

@ -59,7 +59,7 @@ def event_loop(request):
loop = asyncio.get_event_loop()
yield loop
@pytest.fixture(scope="module")
@pytest.fixture(scope="session", autouse=True)
def raise_on_logger_msg():
def proc(logger, method_name, event_dict):
if method_name in ('warn', 'error'):

View File

@ -19,7 +19,7 @@ async def test_regex(get_version):
"regex": 'for (\w+) examples',
}) == "illustrative"
async def test_missing_ok(get_version, raise_on_logger_msg):
async def test_missing_ok(get_version):
assert await get_version("example", {
"url": "http://example.net/",
"regex": "foobar",