Skip to content

Commit

Permalink
Rename CatchLogFuncArg -> LogCaptureFixture
Browse files Browse the repository at this point in the history
.. and CatchLogHandler -> LogCaptureHandler
  • Loading branch information
abusalimov committed Oct 13, 2015
1 parent 944b68b commit 8996725
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions pytest_catchlog.py
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ def __init__(self, config):
@contextmanager
def _runtest_for(self, item, when):
"""Implements the internals of pytest_runtest_xxx() hook."""
with catching_logs(CatchLogHandler(),
with catching_logs(LogCaptureHandler(),
formatter=self.formatter) as log_handler:
item.catch_log_handler = log_handler
try:
Expand Down Expand Up @@ -154,7 +154,7 @@ def pytest_runtest_teardown(self, item):
yield


class CatchLogHandler(logging.StreamHandler):
class LogCaptureHandler(logging.StreamHandler):
"""A logging handler that stores log records and the log text."""

def __init__(self):
Expand All @@ -177,7 +177,7 @@ def emit(self, record):
logging.StreamHandler.emit(self, record)


class CatchLogFuncArg(object):
class LogCaptureFixture(object):
"""Provides access and control of log capturing."""

@property
Expand Down Expand Up @@ -241,6 +241,6 @@ def caplog(request):
* caplog.records() -> list of logging.LogRecord instances
* caplog.record_tuples() -> list of (logger_name, level, message) tuples
"""
return CatchLogFuncArg(request.node)
return LogCaptureFixture(request.node)

capturelog = caplog

0 comments on commit 8996725

Please sign in to comment.