Add session based log disable at test
This commit is contained in:
parent
ea5f64bfea
commit
1935a69c04
1 changed files with 3 additions and 5 deletions
|
@ -419,9 +419,8 @@ def logCaseStart(request):
|
|||
yield None # Wait until all test done
|
||||
|
||||
|
||||
def workaroundPytestLogError():
|
||||
# Workaround for pytest bug when logging in atexit/post-fixture handlers (I/O operation on closed file)
|
||||
|
||||
def workaroundPytestLogError():
|
||||
import _pytest.capture
|
||||
write_original = _pytest.capture.EncodedFile.write
|
||||
|
||||
|
@ -449,9 +448,8 @@ def workaroundPytestLogError():
|
|||
|
||||
workaroundPytestLogError()
|
||||
|
||||
@pytest.fixture(scope='function', autouse=True)
|
||||
def logCaseStart(request):
|
||||
logging.debug("---- Start test case: %s ----" % request._pyfuncitem)
|
||||
@pytest.fixture(scope='session', autouse=True)
|
||||
def disableLog():
|
||||
yield None # Wait until all test done
|
||||
logging.getLogger('').setLevel(logging.getLevelName(logging.CRITICAL))
|
||||
|
||||
|
|
Loading…
Reference in a new issue