Skip to content

Commit 5c7e4a6

Browse files
committed
Code climate: introduce pytest
1 parent 4b97b60 commit 5c7e4a6

File tree

8 files changed

+258
-1
lines changed

8 files changed

+258
-1
lines changed

.coverage

52 KB
Binary file not shown.

.coveragerc

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
# .coveragerc to control coverage.py
2+
[run]
3+
branch = True
4+
omit =
5+
*/.venv/*
6+
7+
[report]
8+
fail_under = 81.42
9+
precision = 2
10+
skip_covered = true
11+
show_missing = true

poetry.lock

Lines changed: 195 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pyproject.toml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,12 @@ python = ">=3.6.2,<4.0"
1010
[tool.poetry.dev-dependencies]
1111
black = "21.9b0"
1212
bump2version = "0.5.11"
13+
coverage = "^5.4"
1314
flake8 = "^3.9.2"
1415
invoke = "1.3.0"
1516
lit = "^0.9"
1617
pylint = "2.12.2"
18+
pytest = "^6.2.2"
1719

1820
[tool.poetry.scripts]
1921
filecheck = "filecheck.filecheck:main"

tasks.py

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -124,6 +124,42 @@ def lint(_):
124124
pass
125125

126126

127+
@task
128+
def test_unit(context):
129+
run_invoke_cmd(
130+
context,
131+
one_line_command(
132+
"""
133+
coverage run
134+
--rcfile=.coveragerc
135+
--branch
136+
-m pytest
137+
tests/unit/
138+
"""
139+
),
140+
)
141+
run_invoke_cmd(
142+
context,
143+
one_line_command(
144+
"""
145+
coverage report --sort=cover
146+
"""
147+
),
148+
)
149+
150+
151+
@task(test_unit)
152+
def test_coverage_report(context):
153+
run_invoke_cmd(
154+
context,
155+
one_line_command(
156+
"""
157+
coverage html
158+
"""
159+
),
160+
)
161+
162+
127163
@task
128164
def test_filecheck_llvm(context, focus=None):
129165
# filecheck_llvm_8_exec = get_filecheck_llvm_path(FILECHECK_LLVM_8_EXEC)

tests/unit/__init__.py

Whitespace-only changes.

tests/unit/conftest.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
# import os
2+
# import sys
3+
#
4+
# STRICTDOC_ROOT_PATH = os.path.abspath(
5+
# os.path.join(__file__, "../../../../strictdoc")
6+
# )
7+
# assert os.path.exists(STRICTDOC_ROOT_PATH), "does not exist: {}".format(
8+
# STRICTDOC_ROOT_PATH
9+
# )
10+
# sys.path.append(STRICTDOC_ROOT_PATH)

tests/unit/test_config.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
2+
3+
def test_01_config():
4+
assert True

0 commit comments

Comments
 (0)