Skip to content

Commit

Permalink
fix pytest configuration in pyproject.toml
Browse files Browse the repository at this point in the history
The config section lacked an "s" at the end of "tool.pytest.ini_options" which
meant that it wasn't picked up.

The "hatch test" scripts shouldn't default to only testing the "tests"
directory, since we want to pick up --doctest-modules (from src) as well.
  • Loading branch information
andreby committed Apr 10, 2024
1 parent 70f60de commit d3d87af
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -81,8 +81,8 @@ dependencies = [
]

[tool.hatch.envs.default.scripts]
test = "pytest {args:tests}"
cov = "coverage run -m pytest {args:tests}"
test = "pytest {args}"
cov = "coverage run -m pytest {args}"
covhtml = [
"coverage combine",
"coverage html",
Expand Down Expand Up @@ -118,12 +118,14 @@ dependencies = [
python = ["3.8", "3.9", "3.10", "3.11", "3.12"]

[tool.hatch.envs.test.scripts]
all = "coverage run -m pytest {args:tests}"
all = "coverage run -m pytest {args}"


# Tool configuration.
[tool.pytest.ini_option]
testpaths = ["tests"]
# # Tool configuration.
[tool.pytest.ini_options]
testpaths = ["tests", "src"]
addopts = "--doctest-modules"


[tool.coverage.run]
disable_warnings = ['no-data-collected']
Expand Down

0 comments on commit d3d87af

Please sign in to comment.