Add loglevel setting to test suite

asyncgen_closing_fix
Tyler Goodlet 2018-07-11 19:25:30 -04:00
parent 590267ded2
commit a26d6f831f
1 changed files with 18 additions and 0 deletions

18
tests/conftest.py 100644
View File

@ -0,0 +1,18 @@
"""
``tractor`` testing!!
"""
import pytest
import tractor
def pytest_addoption(parser):
parser.addoption("--ll", action="store", dest='loglevel',
default=None, help="logging level to set when testing")
@pytest.fixture(scope='session', autouse=True)
def loglevel(request):
orig = tractor._default_loglevel
level = tractor._default_loglevel = request.config.option.loglevel
yield level
tractor._default_loglevel = orig