Skip to content

Commit

Permalink
cli/test-other.py: some PEP 8 formatting fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
firewave committed Aug 21, 2023
1 parent 03b952d commit 074d70f
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion test/cli/test-other.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@

from testutils import cppcheck


def __test_missing_include(tmpdir, use_j):
test_file = os.path.join(tmpdir, 'test.c')
with open(test_file, 'wt') as f:
Expand All @@ -20,12 +21,15 @@ def __test_missing_include(tmpdir, use_j):
_, _, stderr = cppcheck(args)
assert stderr == '{}:2:0: information: Include file: "test.h" not found. [missingInclude]\n'.format(test_file)


def test_missing_include(tmpdir):
__test_missing_include(tmpdir, False)


def test_missing_include_j(tmpdir): #11283
__test_missing_include(tmpdir, True)


def __test_missing_include_check_config(tmpdir, use_j):
test_file = os.path.join(tmpdir, 'test.c')
with open(test_file, 'wt') as f:
Expand All @@ -41,12 +45,15 @@ def __test_missing_include_check_config(tmpdir, use_j):
_, _, stderr = cppcheck(args.split())
assert stderr == '' # --check-config no longer reports the missing includes


def test_missing_include_check_config(tmpdir):
__test_missing_include_check_config(tmpdir, False)


def test_missing_include_check_config_j(tmpdir):
__test_missing_include_check_config(tmpdir, True)


def test_missing_include_inline_suppr(tmpdir):
test_file = os.path.join(tmpdir, 'test.c')
with open(test_file, 'wt') as f:
Expand All @@ -62,6 +69,7 @@ def test_missing_include_inline_suppr(tmpdir):
_, _, stderr = cppcheck(args)
assert stderr == ''


def test_invalid_library(tmpdir):
args = ['--library=none', '--library=posix', '--library=none2', '--platform=native', 'file.c']

Expand All @@ -71,4 +79,4 @@ def test_invalid_library(tmpdir):
"cppcheck: Failed to load library configuration file 'none2'. File not found\n")
assert stderr == ""

# TODO: test missing std.cfg
# TODO: test missing std.cfg

0 comments on commit 074d70f

Please sign in to comment.