2
1

test_lib_ignore.py 603 B

123456789101112131415161718
  1. import pytest
  2. import checkpackagelib.test_util as util
  3. import checkpackagelib.lib_ignore as m
  4. IgnoreMissingFile = [
  5. ('missing ignored file',
  6. '.checkpackageignore',
  7. 'this-file-does-not-exist SomeTest',
  8. [['.checkpackageignore:1: ignored file this-file-does-not-exist is missing',
  9. 'this-file-does-not-exist SomeTest']]),
  10. ]
  11. @pytest.mark.parametrize('testname,filename,string,expected', IgnoreMissingFile)
  12. def test_IgnoreMissingFile(testname, filename, string, expected):
  13. warnings = util.check_file(m.IgnoreMissingFile, filename, string)
  14. assert warnings == expected