@@ -30,6 +30,7 @@ def test_status_new_file(repo_init_with_commit, git2cpp_path, tmp_path, short_fl
3030 if long_flag != "" :
3131 cmd .append (long_flag )
3232 p = subprocess .run (cmd , capture_output = True , cwd = tmp_path , text = True , check = True )
33+ p .stdout = strip_ansi_colours (p .stdout )
3334
3435 if (long_flag == "--long" ) or ((long_flag == "" ) & (short_flag == "" )):
3536 assert "On branch main" in p .stdout
@@ -72,6 +73,7 @@ def test_status_add_file(repo_init_with_commit, git2cpp_path, tmp_path, short_fl
7273 cmd_status .append (long_flag )
7374 p_status = subprocess .run (cmd_status , capture_output = True , cwd = tmp_path , text = True )
7475 assert p_status .returncode == 0
76+ p_status .stdout = strip_ansi_colours (p_status .stdout )
7577
7678 if (long_flag == "--long" ) or ((long_flag == "" ) & (short_flag == "" )):
7779 assert "Changes to be committed" in p_status .stdout
@@ -144,6 +146,7 @@ def test_status_rename_detection(repo_init_with_commit, git2cpp_path, tmp_path,
144146 cmd_status .append (short_flag )
145147 p = subprocess .run (cmd_status , capture_output = True , cwd = tmp_path , text = True )
146148 assert p .returncode == 0
149+ p .stdout = strip_ansi_colours (p .stdout )
147150
148151 # Should show as renamed, not as deleted + new file
149152 assert "initial.txt -> initial_renamed.txt" in p .stdout
@@ -223,6 +226,8 @@ def test_status_typechange(repo_init_with_commit, git2cpp_path, tmp_path, short_
223226 p = subprocess .run (cmd_status , capture_output = True , cwd = tmp_path , text = True )
224227
225228 assert p .returncode == 0
229+ p .stdout = strip_ansi_colours (p .stdout )
230+
226231 # Should show typechange in unstaged changes
227232 if short_flag == "-s" :
228233 assert " T " in p .stdout
@@ -295,6 +300,8 @@ def test_status_ahead_of_upstream(
295300 p = subprocess .run (cmd_status , capture_output = True , cwd = clone_path , text = True )
296301
297302 assert p .returncode == 0
303+ p .stdout = strip_ansi_colours (p .stdout )
304+
298305 if short_flag == "-s" :
299306 if branch_flag == "-b" :
300307 assert "...origin/main" in p .stdout
@@ -341,6 +348,8 @@ def test_status_with_branch_and_tracking(
341348 p = subprocess .run (cmd_status , capture_output = True , cwd = clone_path , text = True )
342349
343350 assert p .returncode == 0
351+ p .stdout = strip_ansi_colours (p .stdout )
352+
344353 if short_flag == "-s" :
345354 assert "## main" in p .stdout # "main" locally, but "master" in the CI
346355 assert "[ahead 1]" in p .stdout
0 commit comments