kumquat-buildroot/utils/checkpackagelib/test_lib_ignore.py
Yann E. MORIN 5eac4f81eb utils/check-package: check ignored files exist
When an ignored file is removed (e.g. a package patch is no longer
needed after a version bump), the corresponding entry in the ignore list
is no longer needed.

However, we currently only validate that an ignored *test* still fails,
not that a ignore files is now missing.

Add a new test to check-package that does that check, and add a
test-case for that check.

Signed-off-by: Yann E. MORIN <yann.morin.1998@free.fr>
Cc: Ricardo Martincoski <ricardo.martincoski@gmail.com>
2023-05-13 12:08:25 +02:00

19 lines
603 B
Python

import pytest
import checkpackagelib.test_util as util
import checkpackagelib.lib_ignore as m
IgnoreMissingFile = [
('missing ignored file',
'.checkpackageignore',
'this-file-does-not-exist SomeTest',
[['.checkpackageignore:1: ignored file this-file-does-not-exist is missing',
'this-file-does-not-exist SomeTest']]),
]
@pytest.mark.parametrize('testname,filename,string,expected', IgnoreMissingFile)
def test_IgnoreMissingFile(testname, filename, string, expected):
warnings = util.check_file(m.IgnoreMissingFile, filename, string)
assert warnings == expected