Skip to content

Fix various version-related CI breakages #1987

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 7 commits into from
Jan 2, 2025
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Instrument handle_process_output test
To try to find the bug that causes it to fail on Cygwin on CI, but
not on other systems on CI, and not locally on Cygwin.

It looks like there's an extra line being read from stderr when the
test fails, so let's examine the lines themselves.
  • Loading branch information
EliahKagan committed Jan 2, 2025
commit 0300de986ef78a4e7a5562638592f5e91bfd8fa7
21 changes: 12 additions & 9 deletions test/test_git.py
Original file line number Diff line number Diff line change
Expand Up @@ -762,14 +762,17 @@ def test_environment(self, rw_dir):
def test_handle_process_output(self):
from git.cmd import handle_process_output, safer_popen

line_count = 5002
count = [None, 0, 0]
expected_line_count = 5002
line_counts = [None, 0, 0]
lines = [None, [], []]

def counter_stdout(line):
count[1] += 1
def stdout_handler(line):
line_counts[1] += 1
lines[1].append(line)

def counter_stderr(line):
count[2] += 1
def stderr_handler(line):
line_counts[2] += 1
lines[2].append(line)

cmdline = [
sys.executable,
Expand All @@ -784,10 +787,10 @@ def counter_stderr(line):
shell=False,
)

handle_process_output(proc, counter_stdout, counter_stderr, finalize_process)
handle_process_output(proc, stdout_handler, stderr_handler, finalize_process)

self.assertEqual(count[1], line_count)
self.assertEqual(count[2], line_count)
self.assertEqual(line_counts[1], expected_line_count, repr(lines[1]))
self.assertEqual(line_counts[2], expected_line_count, repr(lines[2]))

def test_execute_kwargs_set_agrees_with_method(self):
parameter_names = inspect.signature(cmd.Git.execute).parameters.keys()
Expand Down