Skip to content

Commit c4ee5e1

Browse files
fix: decode help-banner test subprocess output as UTF-8
Rich renders the banner panel with box-drawing characters (╭, ╮, │, etc.) that cp1252 cannot decode. On Windows, subprocess.run(..., text=True) uses cp1252 by default, so decoding the child stdout raises UnicodeDecodeError and subprocess sets result.stdout to None — breaking the assertion with a misleading "argument of type 'NoneType' is not iterable". Pass encoding="utf-8" explicitly so the test passes on every platform.
1 parent c455256 commit c4ee5e1

1 file changed

Lines changed: 8 additions & 2 deletions

File tree

tests/test_help_banner.py

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,15 +4,21 @@
44

55
def test_help_displays_logo() -> None:
66
result = subprocess.run(
7-
[sys.executable, "-c", "from codeflash.main import main; main()", "--help"], capture_output=True, text=True
7+
[sys.executable, "-c", "from codeflash.main import main; main()", "--help"],
8+
capture_output=True,
9+
text=True,
10+
encoding="utf-8",
811
)
912
assert result.returncode == 0
1013
assert "codeflash.ai" in result.stdout
1114

1215

1316
def test_help_short_flag_displays_logo() -> None:
1417
result = subprocess.run(
15-
[sys.executable, "-c", "from codeflash.main import main; main()", "-h"], capture_output=True, text=True
18+
[sys.executable, "-c", "from codeflash.main import main; main()", "-h"],
19+
capture_output=True,
20+
text=True,
21+
encoding="utf-8",
1622
)
1723
assert result.returncode == 0
1824
assert "codeflash.ai" in result.stdout

0 commit comments

Comments
 (0)