Fixes #12637: Merged fix from 3.2 and added test.
diff --git a/Lib/test/test_logging.py b/Lib/test/test_logging.py
index 5d84114..793d29b 100644
--- a/Lib/test/test_logging.py
+++ b/Lib/test/test_logging.py
@@ -2923,6 +2923,8 @@
         old_raise_exceptions = logging.raiseExceptions
         try:
             sys.stderr = sio = io.StringIO()
+            root.debug('This should not appear')
+            self.assertEqual(sio.getvalue(), '')
             root.warning('This is your final chance!')
             self.assertEqual(sio.getvalue(), 'This is your final chance!\n')
             #No handlers and no last resort, so 'No handlers' message