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 0da0337
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
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
6 changes: 6 additions & 0 deletions 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_DATA_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 Down

0 comments on commit 0da0337

Please sign in to comment.