@@ -79,10 +79,23 @@ def test_exclude_flag(tmp_path: Path):
7979 """Test the --exclude command-line flag."""
8080 source_dir = tmp_path / "src"
8181 output_file = tmp_path / "output.txt"
82- create_test_files (source_dir , {"include.py" : "include" , "exclude.log" : "exclude" , "also_include.txt" : "include 2" })
82+ create_test_files (
83+ source_dir ,
84+ {
85+ "include.py" : "include" ,
86+ "exclude.log" : "exclude" ,
87+ "also_include.txt" : "include 2" ,
88+ },
89+ )
8390
8491 # Simulate command line: codeconcat ./src output.txt --exclude ".*\\.log$"
85- test_args = ["codeconcat" , str (source_dir ), str (output_file ), "--exclude" , r".*\.log$" ]
92+ test_args = [
93+ "codeconcat" ,
94+ str (source_dir ),
95+ str (output_file ),
96+ "--exclude" ,
97+ r".*\.log$" ,
98+ ]
8699 with patch .object (sys , "argv" , test_args ):
87100 main ()
88101
@@ -97,10 +110,23 @@ def test_whitelist_flag(tmp_path: Path):
97110 """Test the --whitelist command-line flag."""
98111 source_dir = tmp_path / "src"
99112 output_file = tmp_path / "output.txt"
100- create_test_files (source_dir , {"include.py" : "include" , "exclude.txt" : "exclude" , "also_include.py" : "include 2" })
113+ create_test_files (
114+ source_dir ,
115+ {
116+ "include.py" : "include" ,
117+ "exclude.txt" : "exclude" ,
118+ "also_include.py" : "include 2" ,
119+ },
120+ )
101121
102122 # Simulate command line: codeconcat ./src output.txt --whitelist "\.py$"
103- test_args = ["codeconcat" , str (source_dir ), str (output_file ), "--whitelist" , r"\.py$" ]
123+ test_args = [
124+ "codeconcat" ,
125+ str (source_dir ),
126+ str (output_file ),
127+ "--whitelist" ,
128+ r"\.py$" ,
129+ ]
104130 with patch .object (sys , "argv" , test_args ):
105131 main ()
106132
@@ -191,7 +217,11 @@ def test_config_file_loading_home_only(mock_load_config, tmp_path: Path):
191217 )
192218
193219 # Define what load_config_file should return for home and project paths
194- home_config_content = {"use_gitignore" : False , "exclude_patterns" : [r"\.log$" ], "whitelist_patterns" : []}
220+ home_config_content = {
221+ "use_gitignore" : False ,
222+ "exclude_patterns" : [r"\.log$" ],
223+ "whitelist_patterns" : [],
224+ }
195225
196226 def load_side_effect (path ):
197227 if path == HOME_CONFIG_PATH :
@@ -265,7 +295,10 @@ def test_no_files_found(tmp_path: Path, caplog):
265295 output_file = tmp_path / "output.txt"
266296
267297 test_args = ["codeconcat" , str (source_dir ), str (output_file )]
268- with patch .object (sys , "argv" , test_args ), caplog .at_level (logging .WARNING ): # Capture warnings
298+ with (
299+ patch .object (sys , "argv" , test_args ),
300+ caplog .at_level (logging .WARNING ),
301+ ): # Capture warnings
269302 main ()
270303
271304 assert not output_file .exists () # Should not create empty file
0 commit comments