Skip to content

Commit a0f8425

Browse files
committed
Slightly simplify and clarify instrumented code
1 parent 0300de9 commit a0f8425

File tree

1 file changed

+5
-8
lines changed

1 file changed

+5
-8
lines changed

test/test_git.py

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -763,16 +763,13 @@ def test_handle_process_output(self):
763763
from git.cmd import handle_process_output, safer_popen
764764

765765
expected_line_count = 5002
766-
line_counts = [None, 0, 0]
767-
lines = [None, [], []]
766+
actual_lines = [None, [], []]
768767

769768
def stdout_handler(line):
770-
line_counts[1] += 1
771-
lines[1].append(line)
769+
actual_lines[1].append(line)
772770

773771
def stderr_handler(line):
774-
line_counts[2] += 1
775-
lines[2].append(line)
772+
actual_lines[2].append(line)
776773

777774
cmdline = [
778775
sys.executable,
@@ -789,8 +786,8 @@ def stderr_handler(line):
789786

790787
handle_process_output(proc, stdout_handler, stderr_handler, finalize_process)
791788

792-
self.assertEqual(line_counts[1], expected_line_count, repr(lines[1]))
793-
self.assertEqual(line_counts[2], expected_line_count, repr(lines[2]))
789+
self.assertEqual(len(actual_lines[1]), expected_line_count, repr(actual_lines[1]))
790+
self.assertEqual(len(actual_lines[2]), expected_line_count, repr(actual_lines[2]))
794791

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

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy