From 2a2deffd0b461ec5161009b3923623152f4c8f44 Mon Sep 17 00:00:00 2001 From: Julius Unverfehrt Date: Fri, 18 Mar 2022 12:56:32 +0100 Subject: [PATCH] add test infrastructure --- .coveragerc | 54 ++++++++++++++++++++++++++++++++++++++++++++++++ pytest.ini | 2 ++ requirements.txt | 2 ++ test/__init__.py | 0 4 files changed, 58 insertions(+) create mode 100644 .coveragerc create mode 100644 pytest.ini create mode 100644 test/__init__.py diff --git a/.coveragerc b/.coveragerc new file mode 100644 index 0000000..81a0e9a --- /dev/null +++ b/.coveragerc @@ -0,0 +1,54 @@ +# .coveragerc to control coverage.py +[run] +branch = True +omit = + */site-packages/* + */distutils/* + */test/* + */__init__.py + */setup.py + */venv/* + */env/* + */build_venv/* + */build_env/* +source = + image_prediction + src +relative_files = True +data_file = .coverage + +[report] +# Regexes for lines to exclude from consideration +exclude_lines = + # Have to re-enable the standard pragma + pragma: no cover + + # Don't complain about missing debug-only code: + def __repr__ + if self\.debug + + # Don't complain if tests don't hit defensive assertion code: + raise AssertionError + raise NotImplementedError + + # Don't complain if non-runnable code isn't run: + if 0: + if __name__ == .__main__.: +omit = + */site-packages/* + */distutils/* + */test/* + */__init__.py + */setup.py + */venv/* + */env/* + */build_venv/* + */build_env/* + +ignore_errors = True + +[html] +directory = reports + +[xml] +output = reports/coverage.xml diff --git a/pytest.ini b/pytest.ini new file mode 100644 index 0000000..5922a79 --- /dev/null +++ b/pytest.ini @@ -0,0 +1,2 @@ +[pytest] +norecursedirs = incl \ No newline at end of file diff --git a/requirements.txt b/requirements.txt index d20ead3..217a846 100644 --- a/requirements.txt +++ b/requirements.txt @@ -19,3 +19,5 @@ PDFNetPython3~=9.1.0 Pillow~=8.3.2 PyYAML~=5.4.1 scikit_learn~=0.24.2 + +pytest~=7.1.0 \ No newline at end of file diff --git a/test/__init__.py b/test/__init__.py new file mode 100644 index 0000000..e69de29