Skip to content

Commit

Permalink
ci: Configure pytest for testing sources
Browse files Browse the repository at this point in the history
  • Loading branch information
attakei committed Feb 18, 2024
1 parent 04723c3 commit 1881ea5
Show file tree
Hide file tree
Showing 6 changed files with 25 additions and 3 deletions.
4 changes: 4 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,10 @@ jobs:
pip install uv
uv venv
uv pip install -r requirements-dev.lock
- name: Run tests
run: |
source .venv/bin/activate
pytest
build:
runs-on: ubuntu-latest
steps:
Expand Down
7 changes: 6 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,14 @@ classifiers = [
requires = ["hatchling"]
build-backend = "hatchling.build"

[tool.pytest.ini_options]
testpaths = ["tests"]

[tool.rye]
managed = true
dev-dependencies = []
dev-dependencies = [
"pytest~=8.0.1",
]

[tool.rye.scripts]
setup = {chain = ["setup:sync", "setup:pre-commit"]}
Expand Down
9 changes: 8 additions & 1 deletion requirements-dev.lock
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,16 @@
# last locked with the following flags:
# pre: false
# features: []
# all-features: false
# all-features: true
# with-sources: false

-e file:.
docutils==0.20.1
# via rst-multi-refs
iniconfig==2.0.0
# via pytest
packaging==23.2
# via pytest
pluggy==1.4.0
# via pytest
pytest==8.0.1
2 changes: 1 addition & 1 deletion requirements.lock
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
# last locked with the following flags:
# pre: false
# features: []
# all-features: false
# all-features: true
# with-sources: false

-e file:.
Expand Down
4 changes: 4 additions & 0 deletions tests/.ruff.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
extend = "../pyproject.toml"

[lint]
ignore = ["D100", "D103"]
2 changes: 2 additions & 0 deletions tests/test_it.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
def test_it():
import rst_multi_refs # noqa

0 comments on commit 1881ea5

Please sign in to comment.