17
17
class MockOutputSettings (OutputSettingsLoggerInterface ):
18
18
"""Mock implementation of OutputSettingsLoggerInterface for testing."""
19
19
20
- def __init__ (self ):
20
+ def __init__ (self ) -> None :
21
21
self .printshellcmds = True
22
22
self .nocolor = False
23
23
self .quiet = None
@@ -92,7 +92,7 @@ def _create_handler(self) -> LogHandlerBase:
92
92
common_settings = MockOutputSettings ()
93
93
return handler_cls (common_settings = common_settings , settings = settings )
94
94
95
- def test_handler_instantiation (self ):
95
+ def test_handler_instantiation (self ) -> None :
96
96
"""Test that the handler can be properly instantiated."""
97
97
handler = self ._create_handler ()
98
98
@@ -101,7 +101,7 @@ def test_handler_instantiation(self):
101
101
assert isinstance (handler , logging .Handler )
102
102
assert handler .common_settings is not None
103
103
104
- def test_abstract_properties (self ):
104
+ def test_abstract_properties (self ) -> None :
105
105
"""Test that all abstract properties are implemented and return correct types."""
106
106
handler = self ._create_handler ()
107
107
@@ -112,7 +112,7 @@ def test_abstract_properties(self):
112
112
assert isinstance (handler .has_formatter , bool )
113
113
assert isinstance (handler .needs_rulegraph , bool )
114
114
115
- def test_stream_file_exclusivity (self ):
115
+ def test_stream_file_exclusivity (self ) -> None :
116
116
"""Test that handler cannot write to both stream and file."""
117
117
handler = self ._create_handler ()
118
118
@@ -121,27 +121,27 @@ def test_stream_file_exclusivity(self):
121
121
# This should have been caught during initialization
122
122
assert False , "Handler cannot write to both stream and file"
123
123
124
- def test_emit_method (self ):
124
+ def test_emit_method (self ) -> None :
125
125
"""Test that handler has a callable emit method."""
126
126
handler = self ._create_handler ()
127
127
128
128
# Test that handler has emit method (required for logging.Handler)
129
129
assert hasattr (handler , "emit" )
130
130
assert callable (handler .emit )
131
131
132
- def test_basic_logging (self ):
132
+ def test_basic_logging (self ) -> None :
133
133
"""Test basic logging functionality."""
134
134
handler = self ._create_handler ()
135
135
self ._test_basic_logging (handler )
136
136
137
- def test_file_writing_capability (self ):
137
+ def test_file_writing_capability (self ) -> None :
138
138
"""Test file writing capability if enabled."""
139
139
handler = self ._create_handler ()
140
140
141
141
if handler .writes_to_file :
142
142
self ._test_file_writing (handler )
143
143
144
- def _test_basic_logging (self , handler : LogHandlerBase ):
144
+ def _test_basic_logging (self , handler : LogHandlerBase ) -> None :
145
145
"""Test basic logging functionality."""
146
146
# Create a simple log record
147
147
record = logging .LogRecord (
@@ -160,7 +160,7 @@ def _test_basic_logging(self, handler: LogHandlerBase):
160
160
except Exception as e :
161
161
assert False , f"Handler emit method raised unexpected exception: { e } "
162
162
163
- def _test_file_writing (self , handler : LogHandlerBase ):
163
+ def _test_file_writing (self , handler : LogHandlerBase ) -> None :
164
164
"""Test file writing capability if the handler writes to file."""
165
165
# Handler should have baseFilename attribute when writes_to_file is True
166
166
if not hasattr (handler , "baseFilename" ):
0 commit comments