Module: check_mk
Branch: master
Commit: b2c979c13906d63ea15bd2f003c156c753d47f10
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=b2c979c13906d6…
Author: Lars Michelsen <lm(a)mathias-kettner.de>
Date: Tue Sep 6 15:11:35 2016 +0200
Also checking agent plugins for print statements
---
tests/general/test_find_debug_print.py | 9 ++++++---
1 file changed, 6 insertions(+), 3 deletions(-)
diff --git a/tests/general/test_find_debug_print.py
b/tests/general/test_find_debug_print.py
index 771cfe8..9725bd4 100644
--- a/tests/general/test_find_debug_print.py
+++ b/tests/general/test_find_debug_print.py
@@ -16,7 +16,7 @@ check_paths = [
# CMC specific
"agents/bakery",
# TODO: Update all agent plugins to use sys.stdout.write instead of print
- #"agents/plugins",
+ "agents/plugins",
]
def test_find_debug_code():
@@ -33,12 +33,15 @@ def test_find_debug_code():
file_path = "%s/%s" % (dirpath, filename)
for nr, line in enumerate(open(file_path)):
+ if nr == 0 and ("bash" in line or "php" in
line):
+ break # skip non python files
+
l = line.lstrip()
assert not l.startswith("print("), \
"Found \"print(...)\" call in %s:%d" % \
- (file_path, nr)
+ (file_path, nr+1)
assert not l.startswith("print "), \
"Found \"print ...\" call in %s:%d" % \
- (file_path, nr)
+ (file_path, nr+1)
assert scanned > 0