(request)
| 247 | |
| 248 | @pytest.fixture(autouse=True) |
| 249 | def sanity_logging_side_effects(request): |
| 250 | from _pytest.logging import LogCaptureHandler |
| 251 | root = logging.getLogger() |
| 252 | rootlevel = root.level |
| 253 | roothandlers = [ |
| 254 | x for x in root.handlers if not isinstance(x, LogCaptureHandler)] |
| 255 | |
| 256 | yield |
| 257 | |
| 258 | this = request.node.name |
| 259 | root_now = logging.getLogger() |
| 260 | if root_now.level != rootlevel: |
| 261 | raise RuntimeError(CASE_LOG_LEVEL_EFFECT.format(this)) |
| 262 | newhandlers = [x for x in root_now.handlers if not isinstance( |
| 263 | x, LogCaptureHandler)] |
| 264 | if newhandlers != roothandlers: |
| 265 | raise RuntimeError(CASE_LOG_HANDLER_EFFECT.format(this)) |
| 266 | |
| 267 | |
| 268 | def setup_session(scope='session'): |
nothing calls this directly
no test coverage detected
searching dependent graphs…