@@ -43,14 +43,14 @@ def test_quiet_mode_suppresses_info_logging(self, temp_dir, caplog):
4343 """Test that quiet mode suppresses INFO level logging."""
4444 with caplog .at_level (logging .INFO ):
4545 fu = FileUtils (project_root = temp_dir , quiet = True )
46-
46+
4747 # Even though we captured at INFO level, the logger should be at CRITICAL
4848 # So INFO messages should not be logged
4949 assert fu .logger .level == logging .CRITICAL
50-
50+
5151 # Try to log an INFO message
5252 fu .logger .info ("This should not appear" )
53-
53+
5454 # Verify that no INFO messages were actually logged
5555 info_records = [r for r in caplog .records if r .levelno == logging .INFO ]
5656 assert len (info_records ) == 0
@@ -68,7 +68,7 @@ def test_json_output_clean(self, temp_dir):
6868 try :
6969 # Create FileUtils in quiet mode
7070 fu = FileUtils (project_root = temp_dir , quiet = True )
71-
71+
7272 # Perform operations
7373 df = pd .DataFrame ({"a" : [1 , 2 , 3 ], "b" : [4 , 5 , 6 ]})
7474 saved_files , _ = fu .save_data_to_storage (
@@ -78,30 +78,30 @@ def test_json_output_clean(self, temp_dir):
7878 file_name = "test_json" ,
7979 include_timestamp = False ,
8080 )
81-
81+
8282 # Output should be clean (no logging)
8383 output = captured_output .getvalue ()
84-
84+
8585 # In quiet mode, there should be no INFO logging output
8686 # (Though the test itself doesn't print JSON, in real usage
8787 # the application would print structured output here)
8888 assert "FileUtils initialized" not in output
8989 assert "Project root:" not in output
9090 assert "INFO" not in output
91-
91+
9292 finally :
9393 sys .stdout = old_stdout
9494
9595 def test_debug_mode_verbose (self , temp_dir , caplog ):
9696 """Test that DEBUG mode shows verbose logging."""
9797 with caplog .at_level (logging .DEBUG ):
9898 fu = FileUtils (project_root = temp_dir , log_level = logging .DEBUG )
99-
99+
100100 assert fu .logger .level == logging .DEBUG
101-
101+
102102 # Log a debug message
103103 fu .logger .debug ("Debug message" )
104-
104+
105105 # Verify debug message was captured
106106 debug_records = [r for r in caplog .records if r .levelno == logging .DEBUG ]
107107 assert len (debug_records ) > 0
@@ -110,17 +110,19 @@ def test_warning_level_filters_info(self, temp_dir, caplog):
110110 """Test that WARNING level filters out INFO messages."""
111111 with caplog .at_level (logging .DEBUG ): # Capture all levels
112112 fu = FileUtils (project_root = temp_dir , log_level = logging .WARNING )
113-
113+
114114 assert fu .logger .level == logging .WARNING
115-
115+
116116 # Try logging at different levels
117117 fu .logger .info ("Info message" )
118118 fu .logger .warning ("Warning message" )
119-
119+
120120 # Only WARNING and above should be logged
121121 info_records = [r for r in caplog .records if r .levelno == logging .INFO ]
122- warning_records = [r for r in caplog .records if r .levelno == logging .WARNING ]
123-
122+ warning_records = [
123+ r for r in caplog .records if r .levelno == logging .WARNING
124+ ]
125+
124126 # INFO should be filtered out
125127 assert len (info_records ) == 0
126128 # WARNING should be present
@@ -136,11 +138,11 @@ def test_log_level_string_case_insensitive(self, temp_dir):
136138 # Test lowercase
137139 fu1 = FileUtils (project_root = temp_dir , log_level = "warning" )
138140 assert fu1 .logger .level == logging .WARNING
139-
141+
140142 # Test uppercase
141143 fu2 = FileUtils (project_root = temp_dir , log_level = "WARNING" )
142144 assert fu2 .logger .level == logging .WARNING
143-
145+
144146 # Test mixed case
145147 fu3 = FileUtils (project_root = temp_dir , log_level = "Warning" )
146148 assert fu3 .logger .level == logging .WARNING
0 commit comments