You've already forked MicroPythonOS
mirror of
https://github.com/m5stack/MicroPythonOS.git
synced 2026-05-20 11:51:27 -07:00
Simplify
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
import sys
|
||||
import logging.logging as logging
|
||||
import logging
|
||||
|
||||
from mpos import Activity, DisplayMetrics, BuildInfo, DeviceInfo
|
||||
|
||||
|
||||
@@ -0,0 +1 @@
|
||||
from .logging import *
|
||||
+1
-17
@@ -3,27 +3,14 @@
|
||||
import unittest
|
||||
import sys
|
||||
import io
|
||||
import logging.logging as logging
|
||||
import logging
|
||||
|
||||
# Add lib to path so we can import logging
|
||||
sys.path.insert(0, 'MicroPythonOS/internal_filesystem/lib')
|
||||
|
||||
|
||||
class TestLoggingLevels(unittest.TestCase):
|
||||
"""Test that logger levels work correctly with handlers."""
|
||||
|
||||
def setUp(self):
|
||||
"""Set up test fixtures."""
|
||||
# Clear any existing loggers
|
||||
logging._loggers.clear()
|
||||
# Reset basicConfig
|
||||
logging.basicConfig(force=True)
|
||||
|
||||
def tearDown(self):
|
||||
"""Clean up after tests."""
|
||||
logging.shutdown()
|
||||
logging._loggers.clear()
|
||||
|
||||
def test_child_logger_info_level_with_root_handlers(self):
|
||||
"""Test that a child logger can set INFO level and log INFO messages using root handlers."""
|
||||
# Capture output
|
||||
@@ -146,6 +133,3 @@ class TestLoggingLevels(unittest.TestCase):
|
||||
self.assertTrue("info message" not in output)
|
||||
self.assertTrue("warning message" in output)
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
unittest.main()
|
||||
|
||||
@@ -7,17 +7,14 @@ from mpos import TaskManager
|
||||
|
||||
from websocket import WebSocketApp
|
||||
|
||||
|
||||
# demo_multiple_ws.py
|
||||
import asyncio
|
||||
import aiohttp
|
||||
from aiohttp import WSMsgType
|
||||
import logging.logging as logging
|
||||
import logging
|
||||
import sys
|
||||
from typing import List
|
||||
|
||||
|
||||
|
||||
# ----------------------------------------------------------------------
|
||||
# Logging
|
||||
# ----------------------------------------------------------------------
|
||||
|
||||
Reference in New Issue
Block a user