Skip to content

Commit 36fb992

Browse files
authored
Merge pull request #10 from shurph/chore/add-environment-for-tests
Add environment for tests
2 parents 8c85c20 + e39fda8 commit 36fb992

File tree

6 files changed

+25
-0
lines changed

6 files changed

+25
-0
lines changed

.coveragerc

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
[report]
2+
3+
exclude_lines =
4+
if __name__ == .__main__.:

makefile

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,5 +19,8 @@ dependencies:
1919
if [ ! -d $(ROOT_DIR)/env ]; then python3 -m venv $(ROOT_DIR)/env; fi
2020
source $(ROOT_DIR)/env/bin/activate; yes w | python -m pip install -e .[dev]
2121

22+
test:
23+
python setup.py test
24+
2225
package:
2326
source $(ROOT_DIR)/env/bin/activate; python setup.py bdist_wheel

setup.cfg

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,9 @@
11
[metadata]
22
description-file = README.md
3+
4+
[aliases]
5+
test=pytest
6+
7+
[tool:pytest]
8+
addopts = --cov=gitconsensus --cov-report term-missing
9+
python_files = tests/*.py

setup.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,9 @@
4949
],
5050
},
5151

52+
setup_requires=["pytest-runner"],
53+
tests_require=["freezegun", "pytest", "pytest-cov", "pytest-mock"],
54+
5255
entry_points={
5356
'console_scripts': [
5457
'gitconsensus=gitconsensus.gitconsensus:cli',

tests/__init__.py

Whitespace-only changes.

tests/test_cli.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
from click.testing import CliRunner
2+
from gitconsensus.gitconsensus import cli
3+
4+
def test_cli_command():
5+
runner = CliRunner()
6+
result = runner.invoke(cli, ["get-repository"])
7+
assert result.exit_code == 2
8+

0 commit comments

Comments
 (0)