Skip to content

Commit 9c64240

Browse files
committed
mitigated remaining pylint findings
1 parent ffe570c commit 9c64240

4 files changed

Lines changed: 15 additions & 15 deletions

File tree

test/cli/other_test.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1463,7 +1463,7 @@ def test_filelist(tmpdir):
14631463
]
14641464
assert len(expected), len(lines)
14651465
for i in range(1, len(expected)+1):
1466-
lines.remove('{}/11 files checked 0% done'.format(i, len(expected)))
1466+
lines.remove('{}/{} files checked 0% done'.format(i, len(expected)))
14671467
assert lines == expected
14681468

14691469

test/cli/performance_test.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -185,7 +185,7 @@ def test_slow_initlist_varchanged(tmpdir):
185185
}
186186
}""")
187187
cppcheck([filename]) # should not take more than ~1 second
188-
188+
189189

190190
@pytest.mark.timeout(10)
191191
def test_slow_many_scopes(tmpdir):

test/cli/premium_test.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,8 @@ def copy_cppcheck_premium(tmpdir):
3131
"safety": false
3232
}
3333
""".replace('NAME', PRODUCT_NAME))
34-
35-
return exe
34+
35+
return exe
3636

3737

3838
def test_misra_c_builtin_style_checks(tmpdir):

test/cli/testutils.py

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -78,11 +78,11 @@ def __lookup_cppcheck_exe():
7878
def __run_subprocess_tty(args, env=None, cwd=None, timeout=None):
7979
import pty
8080
mo, so = pty.openpty()
81-
me, se = pty.openpty()
81+
me, se = pty.openpty()
8282
p = subprocess.Popen(args, stdout=so, stderr=se, env=env, cwd=cwd)
8383
for fd in [so, se]:
8484
os.close(fd)
85-
85+
8686
select_timeout = 0.04 # seconds
8787
readable = [mo, me]
8888
result = {mo: b'', me: b''}
@@ -110,15 +110,15 @@ def __run_subprocess_tty(args, env=None, cwd=None, timeout=None):
110110
if p.poll() is None:
111111
p.kill()
112112
return_code = p.wait()
113-
113+
114114
stdout = result[mo]
115-
stderr = result[me]
115+
stderr = result[me]
116116
return return_code, stdout, stderr
117117

118-
118+
119119
def __run_subprocess(args, env=None, cwd=None, timeout=None):
120120
p = subprocess.Popen(args, stdout=subprocess.PIPE, stderr=subprocess.PIPE, env=env, cwd=cwd)
121-
121+
122122
try:
123123
comm = p.communicate(timeout=timeout)
124124
return_code = p.returncode
@@ -143,9 +143,9 @@ def __run_subprocess(args, env=None, cwd=None, timeout=None):
143143
#os.killpg(os.getpgid(p.pid), signal.SIGTERM) # Send the signal to all the process groups
144144
p.terminate()
145145
comm = p.communicate()
146-
146+
147147
stdout = comm[0]
148-
stderr = comm[1]
148+
stderr = comm[1]
149149
return return_code, stdout, stderr
150150

151151

@@ -190,13 +190,13 @@ def cppcheck(args, env=None, remove_checkers_report=True, cwd=None, cppcheck_exe
190190
args.append(arg_executor)
191191

192192
logging.info(exe + ' ' + ' '.join(args))
193-
193+
194194
run_subprocess = __run_subprocess_tty if tty else __run_subprocess
195195
return_code, stdout, stderr = run_subprocess([exe] + args, env=env, cwd=cwd, timeout=timeout)
196-
196+
197197
stdout = stdout.decode(encoding='utf-8', errors='ignore').replace('\r\n', '\n')
198198
stderr = stderr.decode(encoding='utf-8', errors='ignore').replace('\r\n', '\n')
199-
199+
200200
if remove_checkers_report:
201201
if stderr.find('[checkersReport]\n') > 0:
202202
start_id = stderr.find('[checkersReport]\n')

0 commit comments

Comments
 (0)