Skip to content

Commit a822d52

Browse files
authored
test: standardize test setup with integration/e2e markers and junit output (#71)
- Expand addopts with standard verbose flags - Broaden testpaths from tests/unit to tests (discovers future dirs) - Add integration and e2e markers - Fix CI: use correct package name (reqstool_python_decorators), add --junitxml - Create empty tests/integration/ and tests/e2e/ directory structure
1 parent 6465023 commit a822d52

6 files changed

Lines changed: 13 additions & 4 deletions

File tree

.github/workflows/build.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,8 @@ jobs:
2828
python-version: "3.13"
2929
- name: Install dependencies
3030
run: pip install hatch
31-
- name: Run unit and integrations tests
32-
run: hatch run dev:pytest --cov=reqstool-python-decorators --cov-report=xml --cov-report=html
31+
- name: Run tests
32+
run: hatch run dev:pytest --junitxml=build/junit.xml --cov=reqstool_python_decorators --cov-report=xml:build/coverage.xml
3333
- name: Build project
3434
run: hatch build
3535
# Upload artifacts for later use

pyproject.toml

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,18 @@ requires = ["hatchling", "hatch-vcs", "build", "twine"]
33
build-backend = "hatchling.build"
44

55
[tool.pytest.ini_options]
6-
addopts = ["-s", "--import-mode=importlib"]
6+
addopts = [
7+
"-rsxX",
8+
"-s",
9+
"--import-mode=importlib",
10+
"--log-cli-level=DEBUG",
11+
]
712
pythonpath = [".", "src", "tests"]
8-
testpaths = ["tests/unit"]
13+
testpaths = ["tests"]
14+
markers = [
15+
"integration: tests that require external resources",
16+
"e2e: end-to-end tests that run the full pipeline locally",
17+
]
918

1019
[project]
1120
name = "reqstool-python-decorators"

tests/e2e/__init__.py

Whitespace-only changes.

tests/e2e/reqstool_decorators/__init__.py

Whitespace-only changes.

tests/integration/__init__.py

Whitespace-only changes.

tests/integration/reqstool_decorators/__init__.py

Whitespace-only changes.

0 commit comments

Comments
 (0)