-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
10 changed files
with
128 additions
and
0 deletions.
There are no files selected for viewing
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
def incrementer(number: int) -> int: | ||
if number == 0: | ||
return 1 | ||
elif number == 1: | ||
return 2 | ||
elif number == 2: | ||
return 3 | ||
else: | ||
return number + 1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
def squarer(number: int) -> int: | ||
return number * number |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
def decrementer(number: int) -> int: | ||
return number - 1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
[isort] | ||
multi_line_output=3 | ||
include_trailing_comma=True | ||
force_grid_wrap=0 | ||
use_parentheses=True | ||
line_length=88 | ||
|
||
[flake8] | ||
ignore = E203, E266, E501, W503 | ||
max-line-length = 88 | ||
max-complexity = 18 | ||
select = B,C,E,F,W,T4 | ||
|
||
[mypy] | ||
files=danger_py_cov,tests | ||
ignore_missing_imports=true | ||
|
||
[tool:pytest] | ||
source = danger_py_cov | ||
python_files = test_*.py | ||
addopts = --cov --cov-report xml:cov.xml --cov-report term | ||
|
||
[coverage:run] | ||
branch = True | ||
source = danger_py_cov | ||
|
||
[pytest-watch] | ||
onpass = osascript -e 'display notification "Congratulations! Everything is green" with title "Tests passed"' | ||
onfail = osascript -e 'display notification "Oops! Something has gone wrong" with title "Tests failed"' | ||
|
||
[coverage:report] | ||
exclude_lines = | ||
pragma: no cover | ||
def __repr__ | ||
if self\.debug | ||
fail_under = 100 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
<?xml version="1.0" ?> | ||
<coverage branch-rate="0.6667" branches-covered="4" branches-valid="6" complexity="0" line-rate="0.6667" lines-covered="8" lines-valid="12" timestamp="1580749415889" version="5.0.3"> | ||
<!-- Generated by coverage.py: https://coverage.readthedocs.io --> | ||
<!-- Based on https://raw.githubusercontent.com/cobertura/web/master/htdocs/xml/coverage-04.dtd --> | ||
<sources> | ||
<source>/Users/kuba/dev/elp/projects/danger-py-cov/danger_py_cov_example</source> | ||
</sources> | ||
<packages> | ||
<package branch-rate="0.6667" complexity="0" line-rate="0.6667" name="."> | ||
<classes> | ||
<class branch-rate="1" complexity="0" filename="__init__.py" line-rate="1" name="__init__.py"> | ||
<methods/> | ||
<lines/> | ||
</class> | ||
<class branch-rate="0.6667" complexity="0" filename="module_one.py" line-rate="0.75" name="module_one.py"> | ||
<methods/> | ||
<lines> | ||
<line hits="1" number="1"/> | ||
<line branch="true" condition-coverage="100% (2/2)" hits="1" number="2"/> | ||
<line hits="1" number="3"/> | ||
<line branch="true" condition-coverage="50% (1/2)" hits="1" missing-branches="5" number="4"/> | ||
<line hits="0" number="5"/> | ||
<line branch="true" condition-coverage="50% (1/2)" hits="1" missing-branches="7" number="6"/> | ||
<line hits="0" number="7"/> | ||
<line hits="1" number="9"/> | ||
</lines> | ||
</class> | ||
<class branch-rate="1" complexity="0" filename="module_three.py" line-rate="1" name="module_three.py"> | ||
<methods/> | ||
<lines> | ||
<line hits="1" number="1"/> | ||
<line hits="1" number="2"/> | ||
</lines> | ||
</class> | ||
<class branch-rate="1" complexity="0" filename="module_two.py" line-rate="0" name="module_two.py"> | ||
<methods/> | ||
<lines> | ||
<line hits="0" number="1"/> | ||
<line hits="0" number="2"/> | ||
</lines> | ||
</class> | ||
</classes> | ||
</package> | ||
</packages> | ||
</coverage> |
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
[tool:pytest] | ||
source = danger_py_cov_example | ||
python_files = tests_example/test_*.py | ||
addopts = --cov --cov-report xml:tests/fixtures/cov_fixture.xml --cov-report term --cov-config tests_example/setup.cfg | ||
|
||
[coverage:run] | ||
branch = True | ||
source = danger_py_cov_example | ||
|
||
[coverage:report] | ||
fail_under = 0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
from danger_py_cov_example.module_one import incrementer | ||
|
||
|
||
def test_incrementer_works_for_zero(): | ||
""" | ||
Test incrementer works for 0. | ||
""" | ||
assert incrementer(0) == 1 | ||
|
||
|
||
def test_incrementer_works_for_ten(): | ||
""" | ||
Test incrementer works for 10. | ||
""" | ||
assert incrementer(10) == 11 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
from danger_py_cov_example.module_three import squarer | ||
|
||
|
||
def test_squarer_works_for_zero(): | ||
""" | ||
Test squarer works for 0. | ||
""" | ||
assert squarer(0) == 0 |