summaryrefslogtreecommitdiffstats
path: root/qa/test_stdin.py
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2021-10-13 05:34:57 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2021-10-13 05:34:57 +0000
commite2d38cd54491535f409372393baeed787c77388d (patch)
treee9f823c384ee487d30de5ae84c8d3755f6974baa /qa/test_stdin.py
parentReleasing debian version 0.15.1-3. (diff)
downloadgitlint-e2d38cd54491535f409372393baeed787c77388d.tar.xz
gitlint-e2d38cd54491535f409372393baeed787c77388d.zip
Merging upstream version 0.16.0.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'qa/test_stdin.py')
-rw-r--r--qa/test_stdin.py8
1 files changed, 4 insertions, 4 deletions
diff --git a/qa/test_stdin.py b/qa/test_stdin.py
index 18d6e7e..c98580e 100644
--- a/qa/test_stdin.py
+++ b/qa/test_stdin.py
@@ -50,7 +50,7 @@ class StdInTests(BaseTestCase):
# We need to use subprocess.Popen() here instead of sh because when passing a file_handle to sh, it will
# deal with reading the file itself instead of passing it on to gitlint as a STDIN. Since we're trying to
# test for the condition where stat.S_ISREG == True that won't work for us here.
- p = subprocess.Popen("gitlint", stdin=file_handle, cwd=self.tmp_git_repo,
- stdout=subprocess.PIPE, stderr=subprocess.STDOUT)
- output, _ = p.communicate()
- self.assertEqual(output.decode(DEFAULT_ENCODING), self.get_expected("test_stdin/test_stdin_file_1"))
+ with subprocess.Popen("gitlint", stdin=file_handle, cwd=self.tmp_git_repo,
+ stdout=subprocess.PIPE, stderr=subprocess.STDOUT) as p:
+ output, _ = p.communicate()
+ self.assertEqual(output.decode(DEFAULT_ENCODING), self.get_expected("test_stdin/test_stdin_file_1"))