Skip to content

Commit

Permalink
add test for skip_file
Browse files Browse the repository at this point in the history
  • Loading branch information
bernt-matthias committed Jan 16, 2024
1 parent 11b15c9 commit 8b2571b
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
4 changes: 4 additions & 0 deletions tests/data/lint_skip_list.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# check that comments work
xml_order
# check the white spaces are ignored
citations
8 changes: 7 additions & 1 deletion tests/test_lint.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
CliTestCase,
PROJECT_TEMPLATES_DIR,
skip_if_environ,
TEST_DATA_DIR,
TEST_REPOS_DIR,
TEST_TOOLS_DIR,
)
Expand Down Expand Up @@ -61,6 +62,11 @@ def test_skips(self):
lint_cmd = ["lint", "--skip", "xml_order, citations", fail_citation]
self._check_exit_code(lint_cmd, exit_code=0)

# Check skip_file (containing the same skips)
skip_file = os.path.join(TEST_TOOLS_DIR, "lint_skip_list.txt")
lint_cmd = ["lint", "--skip_file", skip_file, fail_citation]
self._check_exit_code(lint_cmd, exit_code=0)

def test_recursive(self):
nested_dir = os.path.join(TEST_REPOS_DIR, "multi_repos_nested")

Expand All @@ -73,7 +79,7 @@ def test_recursive(self):
self._check_exit_code(lint_cmd, exit_code=0)

def test_empty_cdata(self):
empty_cdata = os.path.join(TEST_TOOLS_DIR, "empty_cdata.xml")
empty_cdata = os.path.join(TEST_DATA_DIR, "empty_cdata.xml")
lint_cmd = ["lint", "--skip", "citations,help", empty_cdata]
self._check_exit_code(lint_cmd, exit_code=0)

Expand Down

0 comments on commit 8b2571b

Please sign in to comment.