Patchwork [3,of,5] tests: make names in test-stdio.py more distinctive

login
register
mail settings
Submitter Manuel Jacob
Date July 10, 2020, 4:46 a.m.
Message ID <8d2f25abde563d51bfc6.1594356400@tmp>
Download mbox | patch
Permalink /patch/46679/
State Accepted
Headers show

Comments

Manuel Jacob - July 10, 2020, 4:46 a.m.
# HG changeset patch
# User Manuel Jacob <me@manueljacob.de>
# Date 1594113007 -7200
#      Tue Jul 07 11:10:07 2020 +0200
# Node ID 8d2f25abde563d51bfc6296ba4136b9e7a86ecd8
# Parent  0bcb1c7fc0885319f9628de2cb6ea0cca3bf2d7b
# EXP-Topic stdio
tests: make names in test-stdio.py more distinctive

This way, more tests can be added without name clashes.

Patch

diff --git a/tests/test-stdio.py b/tests/test-stdio.py
--- a/tests/test-stdio.py
+++ b/tests/test-stdio.py
@@ -14,7 +14,7 @@ 
 from mercurial import pycompat
 
 
-CHILD_PROCESS = r'''
+BUFFERING_CHILD_SCRIPT = r'''
 import os
 
 from mercurial import dispatch
@@ -89,7 +89,7 @@ 
             proc = subprocess.Popen(
                 [sys.executable]
                 + python_args
-                + ['-c', CHILD_PROCESS.format(stream=stream)],
+                + ['-c', BUFFERING_CHILD_SCRIPT.format(stream=stream)],
                 stdin=child_stdin,
                 stdout=child_stream if stream == 'stdout' else None,
                 stderr=child_stream if stream == 'stderr' else None,
@@ -106,36 +106,36 @@ 
                 retcode = proc.wait()
             self.assertEqual(retcode, 0)
 
-    def test_stdout_pipes(self):
+    def test_buffering_stdout_pipes(self):
         self._test('stdout', _pipes, FULLY_BUFFERED)
 
-    def test_stdout_ptys(self):
+    def test_buffering_stdout_ptys(self):
         self._test('stdout', _ptys, LINE_BUFFERED)
 
-    def test_stdout_pipes_unbuffered(self):
+    def test_buffering_stdout_pipes_unbuffered(self):
         self._test('stdout', _pipes, UNBUFFERED, python_args=['-u'])
 
-    def test_stdout_ptys_unbuffered(self):
+    def test_buffering_stdout_ptys_unbuffered(self):
         self._test('stdout', _ptys, UNBUFFERED, python_args=['-u'])
 
     if not pycompat.ispy3 and not pycompat.iswindows:
         # On Python 2 on non-Windows, we manually open stdout in line-buffered
         # mode if connected to a TTY. We should check if Python was configured
         # to use unbuffered stdout, but it's hard to do that.
-        test_stdout_ptys_unbuffered = unittest.expectedFailure(
-            test_stdout_ptys_unbuffered
+        test_buffering_stdout_ptys_unbuffered = unittest.expectedFailure(
+            test_buffering_stdout_ptys_unbuffered
         )
 
-    def test_stderr_pipes(self):
+    def test_buffering_stderr_pipes(self):
         self._test('stderr', _pipes, UNBUFFERED)
 
-    def test_stderr_ptys(self):
+    def test_buffering_stderr_ptys(self):
         self._test('stderr', _ptys, UNBUFFERED)
 
-    def test_stderr_pipes_unbuffered(self):
+    def test_buffering_stderr_pipes_unbuffered(self):
         self._test('stderr', _pipes, UNBUFFERED, python_args=['-u'])
 
-    def test_stderr_ptys_unbuffered(self):
+    def test_buffering_stderr_ptys_unbuffered(self):
         self._test('stderr', _ptys, UNBUFFERED, python_args=['-u'])