Skip to content

Commit c9be559

Browse files
committed
Update wasm tests in line with latest changes
1 parent 3a52c6b commit c9be559

2 files changed

Lines changed: 11 additions & 1 deletion

File tree

test/conftest_wasm.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ def pytest_ignore_collect(collection_path: pathlib.Path) -> bool:
3434
"test_revlist.py",
3535
"test_revparse.py",
3636
"test_rm.py",
37+
"test_showref.py",
3738
"test_stash.py",
3839
"test_status.py",
3940
"test_tag.py",
@@ -46,7 +47,7 @@ def run_web_server():
4647
cwd = pathlib.Path(__file__).parent.parent / "wasm/test"
4748
proc = subprocess.Popen(["npm", "run", "serve"], stdout=f, stderr=f, cwd=cwd)
4849
# Wait a bit until server ready to receive connections.
49-
time.sleep(0.5)
50+
time.sleep(1)
5051
yield
5152
proc.terminate()
5253

test/test_status.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -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

Comments
 (0)