Skip to content

Commit

Permalink
chore: Template upgrade
Browse files Browse the repository at this point in the history
  • Loading branch information
pawamoy committed Sep 8, 2020
1 parent 4d34342 commit 0994cef
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 6 deletions.
2 changes: 1 addition & 1 deletion .copier-answers.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Changes here will be overwritten by Copier
_commit: 6e49531
_commit: 322f694
_src_path: gh:pawamoy/copier-poetry
author_email: [email protected]
author_fullname: "Timoth\xE9e Mazzucotelli"
Expand Down
3 changes: 3 additions & 0 deletions config/pytest.ini
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,6 @@ python_files =
test_*.py
*_test.py
tests.py
addopts =
--cov
--cov-config config/coverage.ini
4 changes: 3 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -25,12 +25,13 @@ coverage = {version = "^5.2.1", optional = true}
invoke = {version = "^1.4.1", optional = true}
mypy = {version = "^0.782", optional = true}
pytest = {version = "^6.0.1", optional = true}
pytest-cov = {version = "^2.10.1", optional = true}
pytest-randomly = {version = "^3.4.1", optional = true}
pytest-sugar = {version = "^0.9.4", optional = true}
pytest-xdist = {version = "^2.1.0", optional = true}

[tool.poetry.extras]
tests = ["coverage", "invoke", "mypy", "pytest", "pytest-randomly", "pytest-sugar", "pytest-xdist"]
tests = ["coverage", "invoke", "mypy", "pytest", "pytest-cov", "pytest-randomly", "pytest-sugar", "pytest-xdist"]

[tool.poetry.dev-dependencies]
autoflake = "^1.4"
Expand All @@ -57,6 +58,7 @@ mkdocstrings = "^0.13.1"
mypy = "^0.782"
pydantic = "^1.5.1"
pytest = "^6.0.1"
pytest-cov = "^2.10.1"
pytest-randomly = "^3.4.1"
pytest-sugar = "^0.9.4"
pytest-xdist = "^2.1.0"
Expand Down
6 changes: 2 additions & 4 deletions tasks.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,6 @@ def setpath(path: str) -> Generator:
os.environ["PATH"] = current_path



def _python_ci_decorator(func: Callable) -> Callable:
"""
Decorate a task to add `python_version` and `skip` attributes to the context.
Expand All @@ -64,6 +63,7 @@ def _python_ci_decorator(func: Callable) -> Callable:
Returns:
The wrapped function.
"""

@wraps(func) # noqa: WPS430 (nested function)
def wrapper(context, *args, **kwargs):
context.python_version = which("python")
Expand Down Expand Up @@ -333,9 +333,7 @@ def test(context, match=""):
match: A pytest expression to filter selected tests.
"""
title = f"Running tests ({context.python_version})"
command = (
f"coverage run --rcfile=config/coverage.ini -m pytest -c config/pytest.ini -k '{match}' {PY_SRC} 2>/dev/null"
)
command = f"pytest -c config/pytest.ini -n auto -k '{match}' {PY_SRC} 2>/dev/null"
if context.skip:
title += " (missing interpreter)"
command = "true"
Expand Down

0 comments on commit 0994cef

Please sign in to comment.