Module: check_mk
Branch: master
Commit: 3cc472799e1f573185ddf7a24051ab16d609bf71
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=3cc472799e1f57…
Author: Lars Michelsen <lm(a)mathias-kettner.de>
Date: Thu Feb 21 11:43:22 2019 +0100
test_no_exeption: Always close stdin for consistent test behaviour
Change-Id: Ib6b5b4822021009f9d88a86685acbc244c689bfc
---
tests/integration/agents/special/test_executables.py | 8 +++++---
1 file changed, 5 insertions(+), 3 deletions(-)
diff --git a/tests/integration/agents/special/test_executables.py
b/tests/integration/agents/special/test_executables.py
index dfd57fd..fc956d0 100644
--- a/tests/integration/agents/special/test_executables.py
+++ b/tests/integration/agents/special/test_executables.py
@@ -26,6 +26,7 @@
import subprocess
+import os
from pathlib2 import Path
@@ -37,8 +38,9 @@ def test_no_exeption(site):
errors or a wrong PYTHONPATH.
"""
special_agent_dir = Path(site.root) / 'share' / 'check_mk' /
'agents' / 'special'
- for special_agent_path in special_agent_dir.glob('agent_*'):
+ for special_agent_path in special_agent_dir.glob('agent_*'): # pylint:
disable=no-member
command = [str(special_agent_path)]
- p = site.execute(command, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
- stdout, stderr = p.communicate()
+ p = site.execute(
+ command, stdout=subprocess.PIPE, stderr=subprocess.PIPE,
stdin=open(os.devnull))
+ stderr = p.communicate()[1]
assert "Traceback (most recent call last):" not in stderr