feat: initial pytest-aqatfw framework scaffold
This commit is contained in:
+32
@@ -0,0 +1,32 @@
|
||||
# Python cache (ignore all)
|
||||
**/__pycache__/
|
||||
*.py[cod]
|
||||
*$py.class
|
||||
*.pyc
|
||||
*.pyo
|
||||
|
||||
# IDE
|
||||
.idea/
|
||||
.vscode/
|
||||
*.swp
|
||||
*.swo
|
||||
|
||||
# Testing
|
||||
.pytest_cache/
|
||||
.coverage
|
||||
htmlcov/
|
||||
.tox/
|
||||
|
||||
# mypy
|
||||
.mypy_cache/
|
||||
|
||||
# ruff
|
||||
.ruff_cache/
|
||||
|
||||
# Environment
|
||||
.env
|
||||
.venv/
|
||||
venv/
|
||||
|
||||
# uv cache
|
||||
.uv/
|
||||
@@ -0,0 +1,21 @@
|
||||
# pytest-aqatfw
|
||||
|
||||
Тестовый фреймворк на pytest, устанавливается через pip.
|
||||
|
||||
Устанавливается как pytest-плагин (entry point `pytest11`), поэтому fixtures,
|
||||
markers и helpers активируются автоматически у любого проекта с зависимостью
|
||||
на этот пакет.
|
||||
|
||||
```bash
|
||||
pip install pytest-aqatfw
|
||||
# или через uv:
|
||||
uv add pytest-aqatfw
|
||||
```
|
||||
|
||||
Разработка:
|
||||
|
||||
```bash
|
||||
uv sync --group dev
|
||||
uv run pytest
|
||||
uv run ruff check . && uv run mypy .
|
||||
```
|
||||
@@ -0,0 +1,43 @@
|
||||
[project]
|
||||
name = "pytest-aqatfw"
|
||||
version = "0.1.0"
|
||||
description = "Pytest-based AQA test framework, installable via pip"
|
||||
readme = "README.md"
|
||||
authors = [
|
||||
{ name = "Sergey Vanyushkin", email = "pi3c@yandex.ru" }
|
||||
]
|
||||
requires-python = ">=3.13"
|
||||
dependencies = [
|
||||
"pytest>=9.0.0",
|
||||
]
|
||||
|
||||
[project.entry-points."pytest11"]
|
||||
aqatfw = "aqatfw.pytest_plugin"
|
||||
|
||||
[build-system]
|
||||
requires = ["hatchling"]
|
||||
build-backend = "hatchling.build"
|
||||
|
||||
[tool.hatch.build.targets.wheel]
|
||||
packages = ["src/aqatfw"]
|
||||
|
||||
[dependency-groups]
|
||||
dev = [
|
||||
"ruff>=0.15.0",
|
||||
"mypy>=1.20.0",
|
||||
]
|
||||
|
||||
[tool.pytest.ini_options]
|
||||
pythonpath = ["src"]
|
||||
testpaths = ["tests"]
|
||||
|
||||
[tool.mypy]
|
||||
strict = true
|
||||
|
||||
[tool.ruff]
|
||||
target-version = "py313"
|
||||
line-length = 100
|
||||
|
||||
[tool.ruff.lint]
|
||||
select = ["E", "F", "I", "W", "B", "C4", "SIM"]
|
||||
ignore = ["E501"]
|
||||
@@ -0,0 +1,10 @@
|
||||
"""pytest-aqatfw — AQA test framework built on pytest.
|
||||
|
||||
The package installs as a pytest plugin (entry point ``pytest11``),
|
||||
so that any test suite depending on it automatically activates the
|
||||
framework's fixtures, markers, and helpers.
|
||||
"""
|
||||
|
||||
__version__ = "0.1.0"
|
||||
|
||||
__all__ = ["__version__"]
|
||||
@@ -0,0 +1,26 @@
|
||||
"""pytest plugin entry point for pytest-aqatfw.
|
||||
|
||||
Registers the framework with pytest. Framework features (fixtures,
|
||||
markers, hooks) are added here as the project evolves.
|
||||
"""
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
import pytest
|
||||
|
||||
|
||||
def pytest_addoption(parser: pytest.Parser) -> None:
|
||||
"""Add pytest-aqatfw CLI options.
|
||||
|
||||
Reserved for framework configuration flags.
|
||||
"""
|
||||
parser.addoption(
|
||||
"--aqatfw",
|
||||
action="store_true",
|
||||
help="Enable pytest-aqatfw framework features.",
|
||||
)
|
||||
|
||||
|
||||
def pytest_configure(config: pytest.Config) -> None:
|
||||
"""Register framework markers and verify plugin activation."""
|
||||
config.addinivalue_line("markers", "aqatfw: pytest-aqatfw framework marker")
|
||||
@@ -0,0 +1,15 @@
|
||||
"""Smoke tests for pytest-aqatfw plugin activation."""
|
||||
|
||||
import pytest
|
||||
|
||||
|
||||
def test_plugin_marker_registered(pytestconfig: pytest.Config) -> None:
|
||||
"""The aqatfw marker must be registered by the plugin."""
|
||||
markers = [str(m).split(":", 1)[0] for m in pytestconfig.getini("markers")]
|
||||
assert "aqatfw" in markers
|
||||
|
||||
|
||||
@pytest.mark.aqatfw
|
||||
def test_plugin_marker_applies() -> None:
|
||||
"""Applying the framework marker must not break collection."""
|
||||
assert True
|
||||
Reference in New Issue
Block a user