test: use caplog.at_level() to restore log level after test

This commit is contained in:
Alexander Schepanovski
2019-04-24 02:45:02 +03:00
committed by Ruslan Kuprieiev
parent dd8598e53e
commit 277b9e566c
+4 -3
View File
@@ -3,12 +3,13 @@ from git import Repo
from git.exc import GitCommandNotFound
from dvc.repo import Repo as DvcRepo
from .basic_env import TestDirFixture, logger
from .basic_env import TestDirFixture
@pytest.fixture(autouse=True)
def debug():
logger.setLevel("DEBUG")
def debug(caplog):
with caplog.at_level("DEBUG", logger="dvc"):
yield
# Wrap class like fixture as pytest-like one to avoid code duplication