From d12ef55ef8b0275cf37c06711b99dc931f65cdbe Mon Sep 17 00:00:00 2001 From: KevinMidboe Date: Sun, 19 Nov 2017 00:26:51 +0100 Subject: [PATCH] Added test base and coverage report for codecov. --- .codecov.yml | 10 ++++++++++ .coveragerc | 4 ++++ .pytest.ini | 2 ++ requirements-dev.txt | 5 +++++ torrentSearch/tests/__init__.py | 0 torrentSearch/tests/test_sample.py | 5 +++++ 6 files changed, 26 insertions(+) create mode 100644 .codecov.yml create mode 100644 .coveragerc create mode 100644 .pytest.ini create mode 100644 requirements-dev.txt create mode 100644 torrentSearch/tests/__init__.py create mode 100644 torrentSearch/tests/test_sample.py diff --git a/.codecov.yml b/.codecov.yml new file mode 100644 index 0000000..128e21f --- /dev/null +++ b/.codecov.yml @@ -0,0 +1,10 @@ +codecov: + branch: master + bot: 'kevinmidboe-build' + +coverage: + precision: 2 + round: down + range: '70.100' + +comment: off diff --git a/.coveragerc b/.coveragerc new file mode 100644 index 0000000..40c0e9f --- /dev/null +++ b/.coveragerc @@ -0,0 +1,4 @@ +[run] +omit = + */env/*, + */__init__.py diff --git a/.pytest.ini b/.pytest.ini new file mode 100644 index 0000000..89e3f00 --- /dev/null +++ b/.pytest.ini @@ -0,0 +1,2 @@ +[pytest] +python_files= tests.py test_*.py diff --git a/requirements-dev.txt b/requirements-dev.txt new file mode 100644 index 0000000..f7492ca --- /dev/null +++ b/requirements-dev.txt @@ -0,0 +1,5 @@ +-r requirements.txt + +# dependencies for testing +pytest>=3.2.5 +codecov>=1.4.0 diff --git a/torrentSearch/tests/__init__.py b/torrentSearch/tests/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/torrentSearch/tests/test_sample.py b/torrentSearch/tests/test_sample.py new file mode 100644 index 0000000..2aa92e5 --- /dev/null +++ b/torrentSearch/tests/test_sample.py @@ -0,0 +1,5 @@ +def inc(x): + return x + 1 + +def test_answer(): + assert inc(4) == 5 \ No newline at end of file