| 250 | |
| 251 | @pytest.fixture(autouse=True) |
| 252 | def sanity_stdouts(request): |
| 253 | yield |
| 254 | |
| 255 | from celery.utils.log import LoggingProxy |
| 256 | assert sys.stdout |
| 257 | assert sys.stderr |
| 258 | assert sys.__stdout__ |
| 259 | assert sys.__stderr__ |
| 260 | this = request.node.name |
| 261 | if isinstance(sys.stdout, (LoggingProxy, Mock)) or \ |
| 262 | isinstance(sys.__stdout__, (LoggingProxy, Mock)): |
| 263 | raise RuntimeError(CASE_LOG_REDIRECT_EFFECT.format(this, 'stdout')) |
| 264 | if isinstance(sys.stderr, (LoggingProxy, Mock)) or \ |
| 265 | isinstance(sys.__stderr__, (LoggingProxy, Mock)): |
| 266 | raise RuntimeError(CASE_LOG_REDIRECT_EFFECT.format(this, 'stderr')) |
| 267 | |
| 268 | |
| 269 | @pytest.fixture(autouse=True) |