mirror of
https://github.com/azaion/gps-denied-onboard.git
synced 2026-06-21 09: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 numpy as np
|
||||||
import pytest
|
import pytest
|
||||||
|
|
||||||
|
pytestmark = [pytest.mark.unit]
|
||||||
|
|
||||||
from gps_denied.testing.coord import ecef_to_wgs84, euler_to_quaternion
|
from gps_denied.testing.coord import ecef_to_wgs84, euler_to_quaternion
|
||||||
|
|
||||||
# --- ECEF → WGS84 ---
|
# --- ECEF → WGS84 ---
|
||||||
|
|||||||
@@ -2,6 +2,8 @@
|
|||||||
|
|
||||||
import pytest
|
import pytest
|
||||||
|
|
||||||
|
pytestmark = [pytest.mark.unit]
|
||||||
|
|
||||||
from gps_denied.testing.datasets.base import (
|
from gps_denied.testing.datasets.base import (
|
||||||
DatasetAdapter,
|
DatasetAdapter,
|
||||||
DatasetCapabilities,
|
DatasetCapabilities,
|
||||||
|
|||||||
@@ -3,6 +3,10 @@
|
|||||||
import hashlib
|
import hashlib
|
||||||
from pathlib import Path
|
from pathlib import Path
|
||||||
|
|
||||||
|
import pytest
|
||||||
|
|
||||||
|
pytestmark = [pytest.mark.unit]
|
||||||
|
|
||||||
from gps_denied.testing.download import (
|
from gps_denied.testing.download import (
|
||||||
DATASET_REGISTRY,
|
DATASET_REGISTRY,
|
||||||
DatasetSpec,
|
DatasetSpec,
|
||||||
|
|||||||
@@ -13,6 +13,8 @@ from pathlib import Path
|
|||||||
|
|
||||||
import pytest
|
import pytest
|
||||||
|
|
||||||
|
pytestmark = [pytest.mark.e2e]
|
||||||
|
|
||||||
from gps_denied.testing.datasets.euroc import EuRoCAdapter
|
from gps_denied.testing.datasets.euroc import EuRoCAdapter
|
||||||
from gps_denied.testing.harness import E2EHarness
|
from gps_denied.testing.harness import E2EHarness
|
||||||
from gps_denied.testing.metrics import absolute_trajectory_error
|
from gps_denied.testing.metrics import absolute_trajectory_error
|
||||||
|
|||||||
@@ -4,6 +4,8 @@ from pathlib import Path
|
|||||||
|
|
||||||
import pytest
|
import pytest
|
||||||
|
|
||||||
|
pytestmark = [pytest.mark.unit]
|
||||||
|
|
||||||
from gps_denied.testing.datasets.base import (
|
from gps_denied.testing.datasets.base import (
|
||||||
DatasetNotAvailableError,
|
DatasetNotAvailableError,
|
||||||
PlatformClass,
|
PlatformClass,
|
||||||
|
|||||||
@@ -17,6 +17,8 @@ from pathlib import Path
|
|||||||
|
|
||||||
import pytest
|
import pytest
|
||||||
|
|
||||||
|
pytestmark = [pytest.mark.e2e]
|
||||||
|
|
||||||
from gps_denied.testing.datasets.euroc import EuRoCAdapter
|
from gps_denied.testing.datasets.euroc import EuRoCAdapter
|
||||||
from gps_denied.testing.harness import E2EHarness
|
from gps_denied.testing.harness import E2EHarness
|
||||||
from gps_denied.testing.metrics import absolute_trajectory_error
|
from gps_denied.testing.metrics import absolute_trajectory_error
|
||||||
|
|||||||
@@ -20,6 +20,8 @@ import cv2
|
|||||||
import numpy as np
|
import numpy as np
|
||||||
import pytest
|
import pytest
|
||||||
|
|
||||||
|
pytestmark = [pytest.mark.e2e]
|
||||||
|
|
||||||
from gps_denied.core.vo import ORBVisualOdometry
|
from gps_denied.core.vo import ORBVisualOdometry
|
||||||
from gps_denied.schemas import CameraParameters
|
from gps_denied.schemas import CameraParameters
|
||||||
from gps_denied.testing.datasets.euroc import EuRoCAdapter
|
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
|
import pytest
|
||||||
|
|
||||||
|
pytestmark = [pytest.mark.integration]
|
||||||
|
|
||||||
from gps_denied.testing.datasets.synthetic import SyntheticAdapter
|
from gps_denied.testing.datasets.synthetic import SyntheticAdapter
|
||||||
from gps_denied.testing.harness import E2EHarness, HarnessResult
|
from gps_denied.testing.harness import E2EHarness, HarnessResult
|
||||||
|
|
||||||
|
|||||||
@@ -4,6 +4,8 @@ from pathlib import Path
|
|||||||
|
|
||||||
import pytest
|
import pytest
|
||||||
|
|
||||||
|
pytestmark = [pytest.mark.e2e]
|
||||||
|
|
||||||
from gps_denied.testing.datasets.mars_lvig import MARSLVIGAdapter
|
from gps_denied.testing.datasets.mars_lvig import MARSLVIGAdapter
|
||||||
from gps_denied.testing.harness import E2EHarness
|
from gps_denied.testing.harness import E2EHarness
|
||||||
|
|
||||||
|
|||||||
@@ -4,6 +4,8 @@ from pathlib import Path
|
|||||||
|
|
||||||
import pytest
|
import pytest
|
||||||
|
|
||||||
|
pytestmark = [pytest.mark.unit]
|
||||||
|
|
||||||
from gps_denied.testing.datasets.base import (
|
from gps_denied.testing.datasets.base import (
|
||||||
DatasetNotAvailableError,
|
DatasetNotAvailableError,
|
||||||
PlatformClass,
|
PlatformClass,
|
||||||
|
|||||||
@@ -3,6 +3,8 @@
|
|||||||
import numpy as np
|
import numpy as np
|
||||||
import pytest
|
import pytest
|
||||||
|
|
||||||
|
pytestmark = [pytest.mark.unit]
|
||||||
|
|
||||||
from gps_denied.testing.metrics import (
|
from gps_denied.testing.metrics import (
|
||||||
absolute_trajectory_error,
|
absolute_trajectory_error,
|
||||||
relative_pose_error,
|
relative_pose_error,
|
||||||
|
|||||||
@@ -1,8 +1,11 @@
|
|||||||
"""SyntheticAdapter produces a deterministic straight-line trajectory."""
|
"""SyntheticAdapter produces a deterministic straight-line trajectory."""
|
||||||
|
|
||||||
import numpy as np
|
import numpy as np
|
||||||
|
import pytest
|
||||||
|
|
||||||
from gps_denied.testing.datasets.base import PlatformClass
|
from gps_denied.testing.datasets.base import PlatformClass
|
||||||
|
|
||||||
|
pytestmark = [pytest.mark.unit]
|
||||||
from gps_denied.testing.datasets.synthetic import SyntheticAdapter
|
from gps_denied.testing.datasets.synthetic import SyntheticAdapter
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -8,6 +8,8 @@ from pathlib import Path
|
|||||||
|
|
||||||
import pytest
|
import pytest
|
||||||
|
|
||||||
|
pytestmark = [pytest.mark.e2e]
|
||||||
|
|
||||||
from gps_denied.testing.datasets.vpair import VPAIRAdapter
|
from gps_denied.testing.datasets.vpair import VPAIRAdapter
|
||||||
from gps_denied.testing.harness import E2EHarness
|
from gps_denied.testing.harness import E2EHarness
|
||||||
from gps_denied.testing.metrics import absolute_trajectory_error
|
from gps_denied.testing.metrics import absolute_trajectory_error
|
||||||
|
|||||||
@@ -10,6 +10,8 @@ from pathlib import Path
|
|||||||
import numpy as np
|
import numpy as np
|
||||||
import pytest
|
import pytest
|
||||||
|
|
||||||
|
pytestmark = [pytest.mark.unit]
|
||||||
|
|
||||||
from gps_denied.testing.datasets.base import (
|
from gps_denied.testing.datasets.base import (
|
||||||
DatasetNotAvailableError,
|
DatasetNotAvailableError,
|
||||||
PlatformClass,
|
PlatformClass,
|
||||||
|
|||||||
@@ -13,6 +13,8 @@ from unittest.mock import AsyncMock, MagicMock
|
|||||||
import numpy as np
|
import numpy as np
|
||||||
import pytest
|
import pytest
|
||||||
|
|
||||||
|
pytestmark = [pytest.mark.integration]
|
||||||
|
|
||||||
from gps_denied.core.chunk_manager import RouteChunkManager
|
from gps_denied.core.chunk_manager import RouteChunkManager
|
||||||
from gps_denied.core.gpr import GlobalPlaceRecognition
|
from gps_denied.core.gpr import GlobalPlaceRecognition
|
||||||
from gps_denied.core.graph import FactorGraphOptimizer
|
from gps_denied.core.graph import FactorGraphOptimizer
|
||||||
|
|||||||
@@ -22,6 +22,8 @@ import time
|
|||||||
import numpy as np
|
import numpy as np
|
||||||
import pytest
|
import pytest
|
||||||
|
|
||||||
|
pytestmark = [pytest.mark.integration]
|
||||||
|
|
||||||
from gps_denied.core.benchmark import (
|
from gps_denied.core.benchmark import (
|
||||||
AccuracyBenchmark,
|
AccuracyBenchmark,
|
||||||
BenchmarkResult,
|
BenchmarkResult,
|
||||||
|
|||||||
@@ -3,6 +3,9 @@
|
|||||||
import json
|
import json
|
||||||
|
|
||||||
import pytest
|
import pytest
|
||||||
|
|
||||||
|
pytestmark = [pytest.mark.integration]
|
||||||
|
|
||||||
from httpx import ASGITransport, AsyncClient
|
from httpx import ASGITransport, AsyncClient
|
||||||
from sqlalchemy.ext.asyncio import AsyncSession, async_sessionmaker, create_async_engine
|
from sqlalchemy.ext.asyncio import AsyncSession, async_sessionmaker, create_async_engine
|
||||||
|
|
||||||
|
|||||||
@@ -3,6 +3,8 @@
|
|||||||
import numpy as np
|
import numpy as np
|
||||||
import pytest
|
import pytest
|
||||||
|
|
||||||
|
pytestmark = [pytest.mark.unit]
|
||||||
|
|
||||||
from gps_denied.core.chunk_manager import RouteChunkManager
|
from gps_denied.core.chunk_manager import RouteChunkManager
|
||||||
from gps_denied.core.graph import FactorGraphOptimizer
|
from gps_denied.core.graph import FactorGraphOptimizer
|
||||||
from gps_denied.schemas.chunk import ChunkStatus
|
from gps_denied.schemas.chunk import ChunkStatus
|
||||||
|
|||||||
@@ -3,6 +3,8 @@
|
|||||||
import numpy as np
|
import numpy as np
|
||||||
import pytest
|
import pytest
|
||||||
|
|
||||||
|
pytestmark = [pytest.mark.unit]
|
||||||
|
|
||||||
from gps_denied.core.coordinates import (
|
from gps_denied.core.coordinates import (
|
||||||
CoordinateTransformer,
|
CoordinateTransformer,
|
||||||
OriginNotSetError,
|
OriginNotSetError,
|
||||||
|
|||||||
@@ -1,6 +1,9 @@
|
|||||||
"""Tests for the database layer — CRUD, cascade, transactions."""
|
"""Tests for the database layer — CRUD, cascade, transactions."""
|
||||||
|
|
||||||
import pytest
|
import pytest
|
||||||
|
|
||||||
|
pytestmark = [pytest.mark.integration]
|
||||||
|
|
||||||
from sqlalchemy import event
|
from sqlalchemy import event
|
||||||
from sqlalchemy.ext.asyncio import AsyncSession, async_sessionmaker, create_async_engine
|
from sqlalchemy.ext.asyncio import AsyncSession, async_sessionmaker, create_async_engine
|
||||||
|
|
||||||
|
|||||||
@@ -3,6 +3,8 @@
|
|||||||
import numpy as np
|
import numpy as np
|
||||||
import pytest
|
import pytest
|
||||||
|
|
||||||
|
pytestmark = [pytest.mark.unit]
|
||||||
|
|
||||||
from gps_denied.core.coordinates import CoordinateTransformer
|
from gps_denied.core.coordinates import CoordinateTransformer
|
||||||
from gps_denied.core.eskf import ESKF
|
from gps_denied.core.eskf import ESKF
|
||||||
from gps_denied.schemas import GPSPoint
|
from gps_denied.schemas import GPSPoint
|
||||||
|
|||||||
@@ -3,6 +3,8 @@
|
|||||||
import numpy as np
|
import numpy as np
|
||||||
import pytest
|
import pytest
|
||||||
|
|
||||||
|
pytestmark = [pytest.mark.unit]
|
||||||
|
|
||||||
from gps_denied.core.gpr import GlobalPlaceRecognition
|
from gps_denied.core.gpr import GlobalPlaceRecognition
|
||||||
from gps_denied.core.models import ModelManager
|
from gps_denied.core.models import ModelManager
|
||||||
from gps_denied.schemas.gpr import TileCandidate
|
from gps_denied.schemas.gpr import TileCandidate
|
||||||
|
|||||||
@@ -17,6 +17,8 @@ import time
|
|||||||
import numpy as np
|
import numpy as np
|
||||||
import pytest
|
import pytest
|
||||||
|
|
||||||
|
pytestmark = [pytest.mark.blackbox]
|
||||||
|
|
||||||
from gps_denied.core.mavlink import _confidence_to_fix_type, _eskf_to_gps_input
|
from gps_denied.core.mavlink import _confidence_to_fix_type, _eskf_to_gps_input
|
||||||
from gps_denied.schemas import GPSPoint
|
from gps_denied.schemas import GPSPoint
|
||||||
from gps_denied.schemas.eskf import ConfidenceTier, ESKFState
|
from gps_denied.schemas.eskf import ConfidenceTier, ESKFState
|
||||||
|
|||||||
@@ -3,6 +3,8 @@
|
|||||||
import numpy as np
|
import numpy as np
|
||||||
import pytest
|
import pytest
|
||||||
|
|
||||||
|
pytestmark = [pytest.mark.unit]
|
||||||
|
|
||||||
from gps_denied.core.graph import FactorGraphOptimizer
|
from gps_denied.core.graph import FactorGraphOptimizer
|
||||||
from gps_denied.schemas import GPSPoint
|
from gps_denied.schemas import GPSPoint
|
||||||
from gps_denied.schemas.graph import FactorGraphConfig
|
from gps_denied.schemas.graph import FactorGraphConfig
|
||||||
|
|||||||
@@ -1,6 +1,9 @@
|
|||||||
"""Tests for the health endpoint."""
|
"""Tests for the health endpoint."""
|
||||||
|
|
||||||
import pytest
|
import pytest
|
||||||
|
|
||||||
|
pytestmark = [pytest.mark.integration]
|
||||||
|
|
||||||
from httpx import ASGITransport, AsyncClient
|
from httpx import ASGITransport, AsyncClient
|
||||||
|
|
||||||
from gps_denied.app import app
|
from gps_denied.app import app
|
||||||
|
|||||||
@@ -14,6 +14,8 @@ import time
|
|||||||
import numpy as np
|
import numpy as np
|
||||||
import pytest
|
import pytest
|
||||||
|
|
||||||
|
pytestmark = [pytest.mark.unit]
|
||||||
|
|
||||||
from gps_denied.core.mavlink import (
|
from gps_denied.core.mavlink import (
|
||||||
MAVLinkBridge,
|
MAVLinkBridge,
|
||||||
MockMAVConnection,
|
MockMAVConnection,
|
||||||
|
|||||||
@@ -3,6 +3,8 @@
|
|||||||
import numpy as np
|
import numpy as np
|
||||||
import pytest
|
import pytest
|
||||||
|
|
||||||
|
pytestmark = [pytest.mark.unit]
|
||||||
|
|
||||||
from gps_denied.core.metric import MetricRefinement
|
from gps_denied.core.metric import MetricRefinement
|
||||||
from gps_denied.core.models import ModelManager
|
from gps_denied.core.models import ModelManager
|
||||||
from gps_denied.schemas import GPSPoint
|
from gps_denied.schemas import GPSPoint
|
||||||
|
|||||||
@@ -1,9 +1,12 @@
|
|||||||
"""Tests for Model Manager (F16)."""
|
"""Tests for Model Manager (F16)."""
|
||||||
|
|
||||||
import numpy as np
|
import numpy as np
|
||||||
|
import pytest
|
||||||
|
|
||||||
from gps_denied.core.models import ModelManager
|
from gps_denied.core.models import ModelManager
|
||||||
|
|
||||||
|
pytestmark = [pytest.mark.unit]
|
||||||
|
|
||||||
|
|
||||||
def test_load_and_get_model():
|
def test_load_and_get_model():
|
||||||
manager = ModelManager()
|
manager = ModelManager()
|
||||||
|
|||||||
@@ -5,6 +5,8 @@ import cv2
|
|||||||
import numpy as np
|
import numpy as np
|
||||||
import pytest
|
import pytest
|
||||||
|
|
||||||
|
pytestmark = [pytest.mark.unit]
|
||||||
|
|
||||||
from gps_denied.core.pipeline import ImageInputPipeline, QueueFullError
|
from gps_denied.core.pipeline import ImageInputPipeline, QueueFullError
|
||||||
from gps_denied.schemas.image import ImageBatch
|
from gps_denied.schemas.image import ImageBatch
|
||||||
|
|
||||||
|
|||||||
@@ -5,6 +5,8 @@ from unittest.mock import AsyncMock, MagicMock
|
|||||||
import numpy as np
|
import numpy as np
|
||||||
import pytest
|
import pytest
|
||||||
|
|
||||||
|
pytestmark = [pytest.mark.integration]
|
||||||
|
|
||||||
from gps_denied.core.chunk_manager import RouteChunkManager
|
from gps_denied.core.chunk_manager import RouteChunkManager
|
||||||
from gps_denied.core.gpr import GlobalPlaceRecognition
|
from gps_denied.core.gpr import GlobalPlaceRecognition
|
||||||
from gps_denied.core.graph import FactorGraphOptimizer
|
from gps_denied.core.graph import FactorGraphOptimizer
|
||||||
|
|||||||
@@ -14,6 +14,8 @@ from unittest.mock import AsyncMock, MagicMock
|
|||||||
import numpy as np
|
import numpy as np
|
||||||
import pytest
|
import pytest
|
||||||
|
|
||||||
|
pytestmark = [pytest.mark.integration]
|
||||||
|
|
||||||
from gps_denied.core.coordinates import CoordinateTransformer
|
from gps_denied.core.coordinates import CoordinateTransformer
|
||||||
from gps_denied.core.processor import FlightProcessor, TrackingState
|
from gps_denied.core.processor import FlightProcessor, TrackingState
|
||||||
from gps_denied.core.rotation import ImageRotationManager
|
from gps_denied.core.rotation import ImageRotationManager
|
||||||
|
|||||||
@@ -3,6 +3,8 @@
|
|||||||
import numpy as np
|
import numpy as np
|
||||||
import pytest
|
import pytest
|
||||||
|
|
||||||
|
pytestmark = [pytest.mark.unit]
|
||||||
|
|
||||||
from gps_denied.core.chunk_manager import RouteChunkManager
|
from gps_denied.core.chunk_manager import RouteChunkManager
|
||||||
from gps_denied.core.gpr import GlobalPlaceRecognition
|
from gps_denied.core.gpr import GlobalPlaceRecognition
|
||||||
from gps_denied.core.graph import FactorGraphOptimizer
|
from gps_denied.core.graph import FactorGraphOptimizer
|
||||||
|
|||||||
@@ -5,6 +5,8 @@ from datetime import datetime, timezone
|
|||||||
import numpy as np
|
import numpy as np
|
||||||
import pytest
|
import pytest
|
||||||
|
|
||||||
|
pytestmark = [pytest.mark.unit]
|
||||||
|
|
||||||
from gps_denied.core.rotation import IImageMatcher, ImageRotationManager
|
from gps_denied.core.rotation import IImageMatcher, ImageRotationManager
|
||||||
from gps_denied.schemas import GPSPoint
|
from gps_denied.schemas import GPSPoint
|
||||||
from gps_denied.schemas.rotation import RotationResult
|
from gps_denied.schemas.rotation import RotationResult
|
||||||
|
|||||||
@@ -3,6 +3,8 @@
|
|||||||
import numpy as np
|
import numpy as np
|
||||||
import pytest
|
import pytest
|
||||||
|
|
||||||
|
pytestmark = [pytest.mark.unit]
|
||||||
|
|
||||||
from gps_denied.core.satellite import SatelliteDataManager
|
from gps_denied.core.satellite import SatelliteDataManager
|
||||||
from gps_denied.schemas import GPSPoint
|
from gps_denied.schemas import GPSPoint
|
||||||
from gps_denied.utils import mercator
|
from gps_denied.utils import mercator
|
||||||
|
|||||||
@@ -3,6 +3,9 @@
|
|||||||
from datetime import datetime, timezone
|
from datetime import datetime, timezone
|
||||||
|
|
||||||
import pytest
|
import pytest
|
||||||
|
|
||||||
|
pytestmark = [pytest.mark.unit]
|
||||||
|
|
||||||
from pydantic import ValidationError
|
from pydantic import ValidationError
|
||||||
|
|
||||||
from gps_denied.config import get_settings
|
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)
|
_SITL_AVAILABLE = bool(SITL_HOST)
|
||||||
|
|
||||||
pytestmark = pytest.mark.skipif(
|
pytestmark = [pytest.mark.sitl, pytest.mark.skipif(
|
||||||
not _SITL_AVAILABLE,
|
not _SITL_AVAILABLE,
|
||||||
reason="SITL integration tests require ARDUPILOT_SITL_HOST env var",
|
reason="SITL integration tests require ARDUPILOT_SITL_HOST env var",
|
||||||
)
|
)]
|
||||||
|
|
||||||
# ---------------------------------------------------------------------------
|
# ---------------------------------------------------------------------------
|
||||||
# Helpers
|
# Helpers
|
||||||
|
|||||||
@@ -3,6 +3,8 @@
|
|||||||
import numpy as np
|
import numpy as np
|
||||||
import pytest
|
import pytest
|
||||||
|
|
||||||
|
pytestmark = [pytest.mark.unit]
|
||||||
|
|
||||||
from gps_denied.core.models import ModelManager
|
from gps_denied.core.models import ModelManager
|
||||||
from gps_denied.core.vo import (
|
from gps_denied.core.vo import (
|
||||||
CuVSLAMVisualOdometry,
|
CuVSLAMVisualOdometry,
|
||||||
|
|||||||
Reference in New Issue
Block a user