(self)
| 2362 | "dummy.py:42: UserWarning: Explicit\n Dummy line\n") |
| 2363 | |
| 2364 | def test_warnings_no_handlers(self): |
| 2365 | with warnings.catch_warnings(): |
| 2366 | logging.captureWarnings(True) |
| 2367 | self.addCleanup(logging.captureWarnings, False) |
| 2368 | |
| 2369 | # confirm our assumption: no loggers are set |
| 2370 | logger = logging.getLogger("py.warnings") |
| 2371 | self.assertEqual(logger.handlers, []) |
| 2372 | |
| 2373 | warnings.showwarning("Explicit", UserWarning, "dummy.py", 42) |
| 2374 | self.assertEqual(len(logger.handlers), 1) |
| 2375 | self.assertIsInstance(logger.handlers[0], logging.NullHandler) |
| 2376 | |
| 2377 | |
| 2378 | def formatFunc(format, datefmt=None): |
nothing calls this directly
no test coverage detected