Skip to content

Commit 100f99f

Browse files
authored
made more code in Python tests private (danmar#6896)
1 parent 3a3cd12 commit 100f99f

File tree

3 files changed

+13
-13
lines changed

3 files changed

+13
-13
lines changed

test/cli/inline-suppress_test.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ def __create_unused_function_compile_commands(tmpdir):
2626
return compile_commands
2727

2828

29-
def test1():
29+
def test_1():
3030
args = [
3131
'-q',
3232
'--template=simple',
@@ -39,7 +39,7 @@ def test1():
3939
assert ret == 0, stdout
4040

4141

42-
def test2():
42+
def test_2():
4343
args = [
4444
'-q',
4545
'--template=simple',

test/signal/test-signalhandler.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
import sys
44
import pytest
55

6-
def _lookup_cppcheck_exe(exe_name):
6+
def __lookup_cppcheck_exe(exe_name):
77
# path the script is located in
88
script_path = os.path.dirname(os.path.realpath(__file__))
99

@@ -19,8 +19,8 @@ def _lookup_cppcheck_exe(exe_name):
1919

2020
return None
2121

22-
def _call_process(arg):
23-
exe = _lookup_cppcheck_exe('test-signalhandler')
22+
def __call_process(arg):
23+
exe = __lookup_cppcheck_exe('test-signalhandler')
2424
if exe is None:
2525
raise Exception('executable not found')
2626
p = subprocess.Popen([exe, arg], stdout=subprocess.PIPE, stderr=subprocess.PIPE)
@@ -31,7 +31,7 @@ def _call_process(arg):
3131

3232

3333
def test_assert():
34-
_, stdout, stderr = _call_process('assert')
34+
_, stdout, stderr = __call_process('assert')
3535
if sys.platform == "darwin":
3636
assert stderr.startswith("Assertion failed: (false), function my_assert, file test-signalhandler.cpp, line "), stderr
3737
else:
@@ -46,7 +46,7 @@ def test_assert():
4646

4747

4848
def test_abort():
49-
_, stdout, _ = _call_process('abort')
49+
_, stdout, _ = __call_process('abort')
5050
lines = stdout.splitlines()
5151
assert lines[0] == 'Internal error: cppcheck received signal SIGABRT - abort or assertion'
5252
# no stacktrace on MaCos
@@ -57,7 +57,7 @@ def test_abort():
5757

5858

5959
def test_segv():
60-
_, stdout, stderr = _call_process('segv')
60+
_, stdout, stderr = __call_process('segv')
6161
assert stderr == ''
6262
lines = stdout.splitlines()
6363
if sys.platform == "darwin":
@@ -74,7 +74,7 @@ def test_segv():
7474
# TODO: make this work
7575
@pytest.mark.skip
7676
def test_fpe():
77-
_, stdout, stderr = _call_process('fpe')
77+
_, stdout, stderr = __call_process('fpe')
7878
assert stderr == ''
7979
lines = stdout.splitlines()
8080
assert lines[0].startswith('Internal error: cppcheck received signal SIGFPE - FPE_FLTDIV (at 0x7f'), lines[0]

test/signal/test-stacktrace.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
import os
33
import sys
44

5-
def _lookup_cppcheck_exe(exe_name):
5+
def __lookup_cppcheck_exe(exe_name):
66
# path the script is located in
77
script_path = os.path.dirname(os.path.realpath(__file__))
88

@@ -18,8 +18,8 @@ def _lookup_cppcheck_exe(exe_name):
1818

1919
return None
2020

21-
def _call_process():
22-
exe = _lookup_cppcheck_exe('test-stacktrace')
21+
def __call_process():
22+
exe = __lookup_cppcheck_exe('test-stacktrace')
2323
if exe is None:
2424
raise Exception('executable not found')
2525
p = subprocess.Popen([exe], stdout=subprocess.PIPE, stderr=subprocess.PIPE)
@@ -30,7 +30,7 @@ def _call_process():
3030

3131

3232
def test_stack():
33-
_, stdout, stderr = _call_process()
33+
_, stdout, stderr = __call_process()
3434
assert stderr == ''
3535
lines = stdout.splitlines()
3636
assert lines[0] == 'Callstack:'

0 commit comments

Comments
 (0)