瀏覽代碼

chore(backend-testing-01): configure pytest in pyproject.toml

- testpaths set to tests/
- asyncio_mode = auto for pytest-asyncio
- asyncio_default_fixture_loop_scope = function
- markers for hardware and slow tests
- coverage settings with relative_files = true
tuanchris 1 周之前
父節點
當前提交
8e28021f8c
共有 1 個文件被更改,包括 39 次插入0 次删除
  1. 39 0
      pyproject.toml

+ 39 - 0
pyproject.toml

@@ -0,0 +1,39 @@
+[project]
+name = "dune-weaver"
+version = "1.0.0"
+description = "Web-controlled kinetic sand table system"
+requires-python = ">=3.9"
+
+[tool.pytest.ini_options]
+testpaths = ["tests"]
+asyncio_mode = "auto"
+asyncio_default_fixture_loop_scope = "function"
+markers = [
+    "hardware: marks tests requiring real hardware (skip in CI)",
+    "slow: marks slow tests",
+]
+addopts = [
+    "-v",
+    "--tb=short",
+    "--strict-markers",
+]
+filterwarnings = [
+    "ignore::DeprecationWarning",
+]
+
+[tool.coverage.run]
+relative_files = true
+source = ["modules", "main.py"]
+omit = [
+    "tests/*",
+    "*/__pycache__/*",
+]
+
+[tool.coverage.report]
+exclude_lines = [
+    "pragma: no cover",
+    "if TYPE_CHECKING:",
+    "raise NotImplementedError",
+    "if __name__ == .__main__.:",
+]
+show_missing = true