Skip to content

Commit

Permalink
pytest inherits from
Browse files Browse the repository at this point in the history
  • Loading branch information
Tomperez98 committed May 13, 2023
1 parent 9654f88 commit 635beea
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 8 deletions.
3 changes: 2 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,8 @@ dependencies = [
"pip-tools",
"pytest",
"mkdocs-material",
"hatch"
"hatch",
"tomli"
]

[[project.authors]]
Expand Down
6 changes: 1 addition & 5 deletions pyrgo/command/test.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@

from pyrgo.utilities.command import PythonExecCommand, inform_and_run_program
from pyrgo.utilities.project import (
extract_pytest_relevant_paths,
list_pytest_markers,
read_pyproject,
)
Expand Down Expand Up @@ -45,10 +44,7 @@ def test(
marker: Optional[str],
) -> None:
"""Execute tests using `pytest`."""
cwd = pathlib.Path().cwd()
content = read_pyproject(cwd=cwd)

args_to_add = extract_pytest_relevant_paths(content=content)
args_to_add: List[str] = []
if not no_strict_markers:
args_to_add.append("--strict-markers")

Expand Down
2 changes: 0 additions & 2 deletions pyrgo/utilities/project.py
Original file line number Diff line number Diff line change
@@ -1,12 +1,10 @@
"""project utilities."""
import pathlib
from functools import cache
from typing import Any, Dict, List

import tomli


@cache
def read_pyproject(cwd: pathlib.Path) -> Dict[str, Any]:
"""Read `pyproject.toml`."""
path_to_pyproject = cwd.joinpath("pyproject.toml")
Expand Down
1 change: 1 addition & 0 deletions requirements/core.lock
Original file line number Diff line number Diff line change
Expand Up @@ -170,6 +170,7 @@ tomli==2.0.1
# hatchling
# mypy
# pyproject-hooks
# pyrgo (pyproject.toml)
# pytest
tomli-w==1.0.0
# via hatch
Expand Down
1 change: 1 addition & 0 deletions requirements/dev.lock
Original file line number Diff line number Diff line change
Expand Up @@ -170,6 +170,7 @@ tomli==2.0.1
# hatchling
# mypy
# pyproject-hooks
# pyrgo (pyproject.toml)
# pytest
tomli-w==1.0.0
# via hatch
Expand Down

0 comments on commit 635beea

Please sign in to comment.