1515
1616def create_test_console (output , width = 80 ):
1717 """Create a console with consistent settings for testing."""
18- return Console (file = output , width = width , force_terminal = True , color_system = "standard " )
18+ return Console (file = output , width = width , force_terminal = True , color_system = "256 " )
1919
2020
2121class TestMarkdownFeatures :
@@ -282,7 +282,7 @@ class TestCLIInterface:
282282
283283 def test_cli_with_file_input (self , snapshot ):
284284 """Test CLI with file input."""
285- runner = CliRunner ()
285+ runner = CliRunner (env = { "FORCE_COLOR" : "1" , "TERM" : "xterm-256color" } )
286286 with runner .isolated_filesystem ():
287287 # Create a test markdown file
288288 with open ("test.md" , "w" ) as f :
@@ -294,7 +294,7 @@ def test_cli_with_file_input(self, snapshot):
294294
295295 def test_cli_with_stdin (self , snapshot ):
296296 """Test CLI with stdin input."""
297- runner = CliRunner ()
297+ runner = CliRunner (env = { "FORCE_COLOR" : "1" , "TERM" : "xterm-256color" } )
298298 markdown_input = "# Test Header\n \n This is a **test** paragraph with `code`."
299299
300300 result = runner .invoke (main , input = markdown_input )
@@ -303,7 +303,7 @@ def test_cli_with_stdin(self, snapshot):
303303
304304 def test_cli_with_width_option (self , snapshot ):
305305 """Test CLI with custom width option."""
306- runner = CliRunner ()
306+ runner = CliRunner (env = { "FORCE_COLOR" : "1" , "TERM" : "xterm-256color" } )
307307 markdown_input = "# Test Header\n \n This is a very long paragraph that should wrap differently when the terminal width is changed to a smaller value."
308308
309309 result = runner .invoke (main , ["--width" , "40" ], input = markdown_input )
@@ -312,14 +312,14 @@ def test_cli_with_width_option(self, snapshot):
312312
313313 def test_cli_version (self , snapshot ):
314314 """Test CLI version option."""
315- runner = CliRunner ()
315+ runner = CliRunner (env = { "FORCE_COLOR" : "1" , "TERM" : "xterm-256color" } )
316316 result = runner .invoke (main , ["--version" ])
317317 assert result .exit_code == 0
318318 assert result .output == snapshot
319319
320320 def test_cli_help (self , snapshot ):
321321 """Test CLI help option."""
322- runner = CliRunner ()
322+ runner = CliRunner (env = { "FORCE_COLOR" : "1" , "TERM" : "xterm-256color" } )
323323 result = runner .invoke (main , ["--help" ])
324324 assert result .exit_code == 0
325325 assert result .output == snapshot
@@ -411,7 +411,7 @@ def test_very_narrow_width(self, snapshot):
411411
412412 def test_cli_nonexistent_file (self , snapshot ):
413413 """Test CLI with nonexistent file."""
414- runner = CliRunner ()
414+ runner = CliRunner (env = { "FORCE_COLOR" : "1" , "TERM" : "xterm-256color" } )
415415 result = runner .invoke (main , ["nonexistent.md" ])
416416 assert result .exit_code != 0
417417 assert result .output == snapshot
@@ -463,7 +463,7 @@ def test_convert_basic():
463463
464464def test_cli_basic ():
465465 """Test basic CLI functionality (legacy test)."""
466- runner = CliRunner ()
466+ runner = CliRunner (env = { "FORCE_COLOR" : "1" , "TERM" : "xterm-256color" } )
467467 result = runner .invoke (main , input = "# Test\n \n Hello world!" )
468468 # Note: CLI may have exit code 1 due to streaming processing, but output should be correct
469469 assert "Test" in result .output
0 commit comments