2018-07-11 23:25:30 +00:00
|
|
|
"""
|
|
|
|
``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):
|
2018-07-14 20:09:05 +00:00
|
|
|
orig = tractor.log._default_loglevel
|
|
|
|
level = tractor.log._default_loglevel = request.config.option.loglevel
|
2018-07-11 23:25:30 +00:00
|
|
|
yield level
|
2018-07-14 20:09:05 +00:00
|
|
|
tractor.log._default_loglevel = orig
|