mirror of
https://github.com/azaion/gps-denied-onboard.git
synced 2026-06-21 07:01:14 +00:00
feat(02-03): apply module-level pytestmark to 37 test files
- Add pytestmark = [pytest.mark.<category>] to all 23 root test files and 14 e2e test files - Marker distribution: 22 unit, 7 integration, 1 blackbox, 1 sitl, 5 e2e + 2 e2e integration - Add import pytest to test_models.py, test_download.py, test_synthetic_adapter.py (were missing) - Convert test_sitl_integration.py's bare pytestmark to list form preserving skipif guard - Union of all 5 markers = 298/298 = 100% coverage; 216 tests pass with --strict-markers
This commit is contained in:
@@ -3,6 +3,8 @@
|
||||
import numpy as np
|
||||
import pytest
|
||||
|
||||
pytestmark = [pytest.mark.unit]
|
||||
|
||||
from gps_denied.testing.coord import ecef_to_wgs84, euler_to_quaternion
|
||||
|
||||
# --- ECEF → WGS84 ---
|
||||
|
||||
@@ -2,6 +2,8 @@
|
||||
|
||||
import pytest
|
||||
|
||||
pytestmark = [pytest.mark.unit]
|
||||
|
||||
from gps_denied.testing.datasets.base import (
|
||||
DatasetAdapter,
|
||||
DatasetCapabilities,
|
||||
|
||||
@@ -3,6 +3,10 @@
|
||||
import hashlib
|
||||
from pathlib import Path
|
||||
|
||||
import pytest
|
||||
|
||||
pytestmark = [pytest.mark.unit]
|
||||
|
||||
from gps_denied.testing.download import (
|
||||
DATASET_REGISTRY,
|
||||
DatasetSpec,
|
||||
|
||||
@@ -13,6 +13,8 @@ from pathlib import Path
|
||||
|
||||
import pytest
|
||||
|
||||
pytestmark = [pytest.mark.e2e]
|
||||
|
||||
from gps_denied.testing.datasets.euroc import EuRoCAdapter
|
||||
from gps_denied.testing.harness import E2EHarness
|
||||
from gps_denied.testing.metrics import absolute_trajectory_error
|
||||
|
||||
@@ -4,6 +4,8 @@ from pathlib import Path
|
||||
|
||||
import pytest
|
||||
|
||||
pytestmark = [pytest.mark.unit]
|
||||
|
||||
from gps_denied.testing.datasets.base import (
|
||||
DatasetNotAvailableError,
|
||||
PlatformClass,
|
||||
|
||||
@@ -17,6 +17,8 @@ from pathlib import Path
|
||||
|
||||
import pytest
|
||||
|
||||
pytestmark = [pytest.mark.e2e]
|
||||
|
||||
from gps_denied.testing.datasets.euroc import EuRoCAdapter
|
||||
from gps_denied.testing.harness import E2EHarness
|
||||
from gps_denied.testing.metrics import absolute_trajectory_error
|
||||
|
||||
@@ -20,6 +20,8 @@ import cv2
|
||||
import numpy as np
|
||||
import pytest
|
||||
|
||||
pytestmark = [pytest.mark.e2e]
|
||||
|
||||
from gps_denied.core.vo import ORBVisualOdometry
|
||||
from gps_denied.schemas import CameraParameters
|
||||
from gps_denied.testing.datasets.euroc import EuRoCAdapter
|
||||
|
||||
@@ -7,6 +7,8 @@ Correctness of VO on synthetic is out of scope — that's unit-test territory.
|
||||
|
||||
import pytest
|
||||
|
||||
pytestmark = [pytest.mark.integration]
|
||||
|
||||
from gps_denied.testing.datasets.synthetic import SyntheticAdapter
|
||||
from gps_denied.testing.harness import E2EHarness, HarnessResult
|
||||
|
||||
|
||||
@@ -4,6 +4,8 @@ from pathlib import Path
|
||||
|
||||
import pytest
|
||||
|
||||
pytestmark = [pytest.mark.e2e]
|
||||
|
||||
from gps_denied.testing.datasets.mars_lvig import MARSLVIGAdapter
|
||||
from gps_denied.testing.harness import E2EHarness
|
||||
|
||||
|
||||
@@ -4,6 +4,8 @@ from pathlib import Path
|
||||
|
||||
import pytest
|
||||
|
||||
pytestmark = [pytest.mark.unit]
|
||||
|
||||
from gps_denied.testing.datasets.base import (
|
||||
DatasetNotAvailableError,
|
||||
PlatformClass,
|
||||
|
||||
@@ -3,6 +3,8 @@
|
||||
import numpy as np
|
||||
import pytest
|
||||
|
||||
pytestmark = [pytest.mark.unit]
|
||||
|
||||
from gps_denied.testing.metrics import (
|
||||
absolute_trajectory_error,
|
||||
relative_pose_error,
|
||||
|
||||
@@ -1,8 +1,11 @@
|
||||
"""SyntheticAdapter produces a deterministic straight-line trajectory."""
|
||||
|
||||
import numpy as np
|
||||
import pytest
|
||||
|
||||
from gps_denied.testing.datasets.base import PlatformClass
|
||||
|
||||
pytestmark = [pytest.mark.unit]
|
||||
from gps_denied.testing.datasets.synthetic import SyntheticAdapter
|
||||
|
||||
|
||||
|
||||
@@ -8,6 +8,8 @@ from pathlib import Path
|
||||
|
||||
import pytest
|
||||
|
||||
pytestmark = [pytest.mark.e2e]
|
||||
|
||||
from gps_denied.testing.datasets.vpair import VPAIRAdapter
|
||||
from gps_denied.testing.harness import E2EHarness
|
||||
from gps_denied.testing.metrics import absolute_trajectory_error
|
||||
|
||||
@@ -10,6 +10,8 @@ from pathlib import Path
|
||||
import numpy as np
|
||||
import pytest
|
||||
|
||||
pytestmark = [pytest.mark.unit]
|
||||
|
||||
from gps_denied.testing.datasets.base import (
|
||||
DatasetNotAvailableError,
|
||||
PlatformClass,
|
||||
|
||||
@@ -13,6 +13,8 @@ from unittest.mock import AsyncMock, MagicMock
|
||||
import numpy as np
|
||||
import pytest
|
||||
|
||||
pytestmark = [pytest.mark.integration]
|
||||
|
||||
from gps_denied.core.chunk_manager import RouteChunkManager
|
||||
from gps_denied.core.gpr import GlobalPlaceRecognition
|
||||
from gps_denied.core.graph import FactorGraphOptimizer
|
||||
|
||||
@@ -22,6 +22,8 @@ import time
|
||||
import numpy as np
|
||||
import pytest
|
||||
|
||||
pytestmark = [pytest.mark.integration]
|
||||
|
||||
from gps_denied.core.benchmark import (
|
||||
AccuracyBenchmark,
|
||||
BenchmarkResult,
|
||||
|
||||
@@ -3,6 +3,9 @@
|
||||
import json
|
||||
|
||||
import pytest
|
||||
|
||||
pytestmark = [pytest.mark.integration]
|
||||
|
||||
from httpx import ASGITransport, AsyncClient
|
||||
from sqlalchemy.ext.asyncio import AsyncSession, async_sessionmaker, create_async_engine
|
||||
|
||||
|
||||
@@ -3,6 +3,8 @@
|
||||
import numpy as np
|
||||
import pytest
|
||||
|
||||
pytestmark = [pytest.mark.unit]
|
||||
|
||||
from gps_denied.core.chunk_manager import RouteChunkManager
|
||||
from gps_denied.core.graph import FactorGraphOptimizer
|
||||
from gps_denied.schemas.chunk import ChunkStatus
|
||||
|
||||
@@ -3,6 +3,8 @@
|
||||
import numpy as np
|
||||
import pytest
|
||||
|
||||
pytestmark = [pytest.mark.unit]
|
||||
|
||||
from gps_denied.core.coordinates import (
|
||||
CoordinateTransformer,
|
||||
OriginNotSetError,
|
||||
|
||||
@@ -1,6 +1,9 @@
|
||||
"""Tests for the database layer — CRUD, cascade, transactions."""
|
||||
|
||||
import pytest
|
||||
|
||||
pytestmark = [pytest.mark.integration]
|
||||
|
||||
from sqlalchemy import event
|
||||
from sqlalchemy.ext.asyncio import AsyncSession, async_sessionmaker, create_async_engine
|
||||
|
||||
|
||||
@@ -3,6 +3,8 @@
|
||||
import numpy as np
|
||||
import pytest
|
||||
|
||||
pytestmark = [pytest.mark.unit]
|
||||
|
||||
from gps_denied.core.coordinates import CoordinateTransformer
|
||||
from gps_denied.core.eskf import ESKF
|
||||
from gps_denied.schemas import GPSPoint
|
||||
|
||||
@@ -3,6 +3,8 @@
|
||||
import numpy as np
|
||||
import pytest
|
||||
|
||||
pytestmark = [pytest.mark.unit]
|
||||
|
||||
from gps_denied.core.gpr import GlobalPlaceRecognition
|
||||
from gps_denied.core.models import ModelManager
|
||||
from gps_denied.schemas.gpr import TileCandidate
|
||||
|
||||
@@ -17,6 +17,8 @@ import time
|
||||
import numpy as np
|
||||
import pytest
|
||||
|
||||
pytestmark = [pytest.mark.blackbox]
|
||||
|
||||
from gps_denied.core.mavlink import _confidence_to_fix_type, _eskf_to_gps_input
|
||||
from gps_denied.schemas import GPSPoint
|
||||
from gps_denied.schemas.eskf import ConfidenceTier, ESKFState
|
||||
|
||||
@@ -3,6 +3,8 @@
|
||||
import numpy as np
|
||||
import pytest
|
||||
|
||||
pytestmark = [pytest.mark.unit]
|
||||
|
||||
from gps_denied.core.graph import FactorGraphOptimizer
|
||||
from gps_denied.schemas import GPSPoint
|
||||
from gps_denied.schemas.graph import FactorGraphConfig
|
||||
|
||||
@@ -1,6 +1,9 @@
|
||||
"""Tests for the health endpoint."""
|
||||
|
||||
import pytest
|
||||
|
||||
pytestmark = [pytest.mark.integration]
|
||||
|
||||
from httpx import ASGITransport, AsyncClient
|
||||
|
||||
from gps_denied.app import app
|
||||
|
||||
@@ -14,6 +14,8 @@ import time
|
||||
import numpy as np
|
||||
import pytest
|
||||
|
||||
pytestmark = [pytest.mark.unit]
|
||||
|
||||
from gps_denied.core.mavlink import (
|
||||
MAVLinkBridge,
|
||||
MockMAVConnection,
|
||||
|
||||
@@ -3,6 +3,8 @@
|
||||
import numpy as np
|
||||
import pytest
|
||||
|
||||
pytestmark = [pytest.mark.unit]
|
||||
|
||||
from gps_denied.core.metric import MetricRefinement
|
||||
from gps_denied.core.models import ModelManager
|
||||
from gps_denied.schemas import GPSPoint
|
||||
|
||||
@@ -1,9 +1,12 @@
|
||||
"""Tests for Model Manager (F16)."""
|
||||
|
||||
import numpy as np
|
||||
import pytest
|
||||
|
||||
from gps_denied.core.models import ModelManager
|
||||
|
||||
pytestmark = [pytest.mark.unit]
|
||||
|
||||
|
||||
def test_load_and_get_model():
|
||||
manager = ModelManager()
|
||||
|
||||
@@ -5,6 +5,8 @@ import cv2
|
||||
import numpy as np
|
||||
import pytest
|
||||
|
||||
pytestmark = [pytest.mark.unit]
|
||||
|
||||
from gps_denied.core.pipeline import ImageInputPipeline, QueueFullError
|
||||
from gps_denied.schemas.image import ImageBatch
|
||||
|
||||
|
||||
@@ -5,6 +5,8 @@ from unittest.mock import AsyncMock, MagicMock
|
||||
import numpy as np
|
||||
import pytest
|
||||
|
||||
pytestmark = [pytest.mark.integration]
|
||||
|
||||
from gps_denied.core.chunk_manager import RouteChunkManager
|
||||
from gps_denied.core.gpr import GlobalPlaceRecognition
|
||||
from gps_denied.core.graph import FactorGraphOptimizer
|
||||
|
||||
@@ -14,6 +14,8 @@ from unittest.mock import AsyncMock, MagicMock
|
||||
import numpy as np
|
||||
import pytest
|
||||
|
||||
pytestmark = [pytest.mark.integration]
|
||||
|
||||
from gps_denied.core.coordinates import CoordinateTransformer
|
||||
from gps_denied.core.processor import FlightProcessor, TrackingState
|
||||
from gps_denied.core.rotation import ImageRotationManager
|
||||
|
||||
@@ -3,6 +3,8 @@
|
||||
import numpy as np
|
||||
import pytest
|
||||
|
||||
pytestmark = [pytest.mark.unit]
|
||||
|
||||
from gps_denied.core.chunk_manager import RouteChunkManager
|
||||
from gps_denied.core.gpr import GlobalPlaceRecognition
|
||||
from gps_denied.core.graph import FactorGraphOptimizer
|
||||
|
||||
@@ -5,6 +5,8 @@ from datetime import datetime, timezone
|
||||
import numpy as np
|
||||
import pytest
|
||||
|
||||
pytestmark = [pytest.mark.unit]
|
||||
|
||||
from gps_denied.core.rotation import IImageMatcher, ImageRotationManager
|
||||
from gps_denied.schemas import GPSPoint
|
||||
from gps_denied.schemas.rotation import RotationResult
|
||||
|
||||
@@ -3,6 +3,8 @@
|
||||
import numpy as np
|
||||
import pytest
|
||||
|
||||
pytestmark = [pytest.mark.unit]
|
||||
|
||||
from gps_denied.core.satellite import SatelliteDataManager
|
||||
from gps_denied.schemas import GPSPoint
|
||||
from gps_denied.utils import mercator
|
||||
|
||||
@@ -3,6 +3,9 @@
|
||||
from datetime import datetime, timezone
|
||||
|
||||
import pytest
|
||||
|
||||
pytestmark = [pytest.mark.unit]
|
||||
|
||||
from pydantic import ValidationError
|
||||
|
||||
from gps_denied.config import get_settings
|
||||
|
||||
@@ -42,10 +42,10 @@ SITL_PORT = int(os.environ.get("ARDUPILOT_SITL_PORT", "5762"))
|
||||
|
||||
_SITL_AVAILABLE = bool(SITL_HOST)
|
||||
|
||||
pytestmark = pytest.mark.skipif(
|
||||
pytestmark = [pytest.mark.sitl, pytest.mark.skipif(
|
||||
not _SITL_AVAILABLE,
|
||||
reason="SITL integration tests require ARDUPILOT_SITL_HOST env var",
|
||||
)
|
||||
)]
|
||||
|
||||
# ---------------------------------------------------------------------------
|
||||
# Helpers
|
||||
|
||||
@@ -3,6 +3,8 @@
|
||||
import numpy as np
|
||||
import pytest
|
||||
|
||||
pytestmark = [pytest.mark.unit]
|
||||
|
||||
from gps_denied.core.models import ModelManager
|
||||
from gps_denied.core.vo import (
|
||||
CuVSLAMVisualOdometry,
|
||||
|
||||
Reference in New Issue
Block a user