summaryrefslogtreecommitdiff
path: root/Lib/test/test_logging.py
diff options
context:
space:
mode:
Diffstat (limited to 'Lib/test/test_logging.py')
-rw-r--r--Lib/test/test_logging.py26
1 files changed, 6 insertions, 20 deletions
diff --git a/Lib/test/test_logging.py b/Lib/test/test_logging.py
index 9998f1a02e..211fe4bbd7 100644
--- a/Lib/test/test_logging.py
+++ b/Lib/test/test_logging.py
@@ -5514,25 +5514,11 @@ class MiscTestCase(unittest.TestCase):
# Set the locale to the platform-dependent default. I have no idea
# why the test does this, but in any case we save the current locale
# first and restore it at the end.
-@support.run_with_locale('LC_ALL', '')
-def test_main():
- tests = [
- BuiltinLevelsTest, BasicFilterTest, CustomLevelsAndFiltersTest,
- HandlerTest, MemoryHandlerTest, ConfigFileTest, SocketHandlerTest,
- DatagramHandlerTest, MemoryTest, EncodingTest, WarningsTest,
- ConfigDictTest, ManagerTest, FormatterTest, BufferingFormatterTest,
- StreamHandlerTest, LogRecordFactoryTest, ChildLoggerTest,
- QueueHandlerTest, ShutdownTest, ModuleLevelMiscTest, BasicConfigTest,
- LoggerAdapterTest, LoggerTest, SMTPHandlerTest, FileHandlerTest,
- RotatingFileHandlerTest, LastResortTest, LogRecordTest,
- ExceptionTest, SysLogHandlerTest, IPv6SysLogHandlerTest, HTTPHandlerTest,
- NTEventLogHandlerTest, TimedRotatingFileHandlerTest,
- UnixSocketHandlerTest, UnixDatagramHandlerTest, UnixSysLogHandlerTest,
- MiscTestCase
- ]
- if hasattr(logging.handlers, 'QueueListener'):
- tests.append(QueueListenerTest)
- support.run_unittest(*tests)
+def setUpModule():
+ cm = support.run_with_locale('LC_ALL', '')
+ cm.__enter__()
+ unittest.addModuleCleanup(cm.__exit__, None, None, None)
+
if __name__ == "__main__":
- test_main()
+ unittest.main()