mirror of
https://github.com/Kozea/WeasyPrint.git
synced 2024-10-04 07:57:52 +03:00
test: only assert on non-debug logs
This commit is contained in:
parent
f262e8ddd5
commit
9e8eaae25d
@ -1,6 +1,7 @@
|
|||||||
"""Helpers for tests."""
|
"""Helpers for tests."""
|
||||||
|
|
||||||
import functools
|
import functools
|
||||||
|
import logging
|
||||||
import sys
|
import sys
|
||||||
from pathlib import Path
|
from pathlib import Path
|
||||||
|
|
||||||
@ -76,7 +77,7 @@ def assert_no_logs(function):
|
|||||||
"""Decorator that asserts that nothing is logged in a function."""
|
"""Decorator that asserts that nothing is logged in a function."""
|
||||||
@functools.wraps(function)
|
@functools.wraps(function)
|
||||||
def wrapper(*args, **kwargs):
|
def wrapper(*args, **kwargs):
|
||||||
with capture_logs() as logs:
|
with capture_logs(level=logging.INFO) as logs:
|
||||||
try:
|
try:
|
||||||
function(*args, **kwargs)
|
function(*args, **kwargs)
|
||||||
except Exception: # pragma: no cover
|
except Exception: # pragma: no cover
|
||||||
|
Loading…
Reference in New Issue
Block a user