Skip to content

Commit cb94b35

Browse files
committed
type checker
1 parent d89ad89 commit cb94b35

File tree

1 file changed

+9
-9
lines changed
  • src/snakemake_interface_logger_plugins

1 file changed

+9
-9
lines changed

src/snakemake_interface_logger_plugins/tests.py

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
class MockOutputSettings(OutputSettingsLoggerInterface):
1818
"""Mock implementation of OutputSettingsLoggerInterface for testing."""
1919

20-
def __init__(self):
20+
def __init__(self) -> None:
2121
self.printshellcmds = True
2222
self.nocolor = False
2323
self.quiet = None
@@ -92,7 +92,7 @@ def _create_handler(self) -> LogHandlerBase:
9292
common_settings = MockOutputSettings()
9393
return handler_cls(common_settings=common_settings, settings=settings)
9494

95-
def test_handler_instantiation(self):
95+
def test_handler_instantiation(self) -> None:
9696
"""Test that the handler can be properly instantiated."""
9797
handler = self._create_handler()
9898

@@ -101,7 +101,7 @@ def test_handler_instantiation(self):
101101
assert isinstance(handler, logging.Handler)
102102
assert handler.common_settings is not None
103103

104-
def test_abstract_properties(self):
104+
def test_abstract_properties(self) -> None:
105105
"""Test that all abstract properties are implemented and return correct types."""
106106
handler = self._create_handler()
107107

@@ -112,7 +112,7 @@ def test_abstract_properties(self):
112112
assert isinstance(handler.has_formatter, bool)
113113
assert isinstance(handler.needs_rulegraph, bool)
114114

115-
def test_stream_file_exclusivity(self):
115+
def test_stream_file_exclusivity(self) -> None:
116116
"""Test that handler cannot write to both stream and file."""
117117
handler = self._create_handler()
118118

@@ -121,27 +121,27 @@ def test_stream_file_exclusivity(self):
121121
# This should have been caught during initialization
122122
assert False, "Handler cannot write to both stream and file"
123123

124-
def test_emit_method(self):
124+
def test_emit_method(self) -> None:
125125
"""Test that handler has a callable emit method."""
126126
handler = self._create_handler()
127127

128128
# Test that handler has emit method (required for logging.Handler)
129129
assert hasattr(handler, "emit")
130130
assert callable(handler.emit)
131131

132-
def test_basic_logging(self):
132+
def test_basic_logging(self) -> None:
133133
"""Test basic logging functionality."""
134134
handler = self._create_handler()
135135
self._test_basic_logging(handler)
136136

137-
def test_file_writing_capability(self):
137+
def test_file_writing_capability(self) -> None:
138138
"""Test file writing capability if enabled."""
139139
handler = self._create_handler()
140140

141141
if handler.writes_to_file:
142142
self._test_file_writing(handler)
143143

144-
def _test_basic_logging(self, handler: LogHandlerBase):
144+
def _test_basic_logging(self, handler: LogHandlerBase) -> None:
145145
"""Test basic logging functionality."""
146146
# Create a simple log record
147147
record = logging.LogRecord(
@@ -160,7 +160,7 @@ def _test_basic_logging(self, handler: LogHandlerBase):
160160
except Exception as e:
161161
assert False, f"Handler emit method raised unexpected exception: {e}"
162162

163-
def _test_file_writing(self, handler: LogHandlerBase):
163+
def _test_file_writing(self, handler: LogHandlerBase) -> None:
164164
"""Test file writing capability if the handler writes to file."""
165165
# Handler should have baseFilename attribute when writes_to_file is True
166166
if not hasattr(handler, "baseFilename"):

0 commit comments

Comments
 (0)