Skip to content

Commit

Permalink
Improve coverage threshold
Browse files Browse the repository at this point in the history
  • Loading branch information
staticdev committed Dec 27, 2021
1 parent deb337d commit fca3ef1
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 21 deletions.
2 changes: 0 additions & 2 deletions .coveragerc

This file was deleted.

13 changes: 5 additions & 8 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,14 +1,11 @@
*~
\#*
\.\#*
*.pyc
*.egg-info/
venv/
.coverage*
coverage.xml
dist/
build/
runtests.py
/.coverage
/.coverage.*
/.nox/
/dist/
.cache
*.swp
.ropeproject/
__pycache__/
4 changes: 2 additions & 2 deletions codecov.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ coverage:
status:
project:
default:
target: "85"
target: "90"
patch:
default:
target: "85"
target: "90"
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ source = ["inquirer", "tests"]

[tool.coverage.report]
show_missing = true
fail_under = 85
fail_under = 90

[build-system]
requires = ["poetry-core>=1.0.0"]
Expand Down
15 changes: 7 additions & 8 deletions tests/unit/test_question.py
Original file line number Diff line number Diff line change
Expand Up @@ -260,14 +260,13 @@ def do_test(path, result=True):

do_test(None, False)

if os.environ.get("TRAVIS_PYTHON_VERSION") != "pypy3":
# Path component must not be longer then 255 bytes
do_test("a" * 256, False)
do_test(os.path.abspath("/asdf/" + "a" * 256), False)
do_test("{}/{}".format("a" * 255, "b" * 255), True)

# Path component must not contains null bytes
do_test("some/path/with/{}byte".format(b"\x00".decode("utf-8")), False)
# Path component must not be longer then 255 bytes
do_test("a" * 256, False)
do_test(os.path.abspath("/asdf/" + "a" * 256), False)
do_test("{}/{}".format("a" * 255, "b" * 255), True)

# Path component must not contains null bytes
do_test("some/path/with/{}byte".format(b"\x00".decode("utf-8")), False)

def test_path_type_validation_no_existence_check(self):
def do_test(path_type, path, result=True):
Expand Down

0 comments on commit fca3ef1

Please sign in to comment.