Skip to content

Commit

Permalink
minor changes to increase coverage
Browse files Browse the repository at this point in the history
  • Loading branch information
gawebb-dstl committed Apr 8, 2024
1 parent 8e4fd44 commit 1521e2f
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
4 changes: 2 additions & 2 deletions stonesoup/tracker/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ class _TrackerMixInNext(_TrackerMixInBase):

@abstractmethod
def __next__(self) -> Tuple[datetime.datetime, Set[Track]]:
...
"""Pull detections from the detector (`detector_iter`). Act on them to create tracks."""

def update_tracker(self, time: datetime.datetime, detections: Set[Detection]) \
-> Tuple[datetime.datetime, Set[Track]]:
Expand All @@ -73,4 +73,4 @@ def __next__(self) -> Tuple[datetime.datetime, Set[Track]]:
@abstractmethod
def update_tracker(self, time: datetime.datetime, detections: Set[Detection]) \
-> Tuple[datetime.datetime, Set[Track]]:
...
"""Use `time` and `detections` to create tracks."""
7 changes: 7 additions & 0 deletions stonesoup/tracker/tests/test_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,13 @@ def test_tracker_without_detector_iter_error(tracker_class):
next(tracker_without_detector)


@pytest.mark.parametrize("tracker_class", [TrackerNextWithDetector, TrackerUpdateWithDetector])
def test_tracker_without_detector_iter_error(tracker_class):
tracker = tracker_class(detector=None)
with pytest.raises(AttributeError):
iter(tracker)


@pytest.mark.parametrize("tracker_class", [TrackerNextWithDetector, TrackerUpdateWithDetector])
def test_tracker_with_detector_iter(tracker_class):
tracker = tracker_class()
Expand Down

0 comments on commit 1521e2f

Please sign in to comment.