Skip to content

Commit

Permalink
chore(ci): fix examples testing
Browse files Browse the repository at this point in the history
There are two hatch scripts which call pytest, `hatch run test` and
`hatch run example`. The scripts allow for additional arguments which
get passed along to `pytest` with an optional default. This was
misconfigured for the examples:

\## Before

`hatch run examples` becomes `pytest run examples/`
`hatch run examples --broker-url=...` becomes `pytest run --broker-url=...`

\## Now

`hatch run examples` becomes `pytest run examples/`
`hatch run examples --broker-url=...` becomes `pytest run examples/ --broker-url=...`

Signed-off-by: JP-Ellis <[email protected]>
  • Loading branch information
JP-Ellis committed Nov 15, 2023
1 parent 5292f7d commit 111447a
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ extra-dependencies = ["hatchling", "packaging", "requests", "cffi"]
[tool.hatch.envs.default.scripts]
lint = ["black --check --diff {args:.}", "ruff {args:.}", "mypy {args:.}"]
test = "pytest {args:tests/}"
example = "pytest {args:examples/}"
example = "pytest examples/ {args}"
all = ["lint", "test", "example"]

# Test environment for running unit tests. This automatically tests against all
Expand All @@ -129,7 +129,7 @@ python = ["3.8", "3.9", "3.10", "3.11"]

[tool.hatch.envs.test.scripts]
test = "pytest {args:tests/}"
example = "pytest {args:examples/}"
example = "pytest examples/ {args}"
all = ["test", "example"]

################################################################################
Expand Down

0 comments on commit 111447a

Please sign in to comment.