Skip to content

[Bug]: 3 syntax bugs blocking pytest collection (tracker.py + inspect_tracks.py) #149

@Deepthit-23

Description

@Deepthit-23

Affected Component

Tracking (ByteTrack / DeepSORT — services/tracking/)

Bug Description

Test Suite Blocked: Collection Phase Failure
Running pytest tests/ -v fails immediately during the collection phase due to 3 syntax/attribute errors. None of the 232 tests can execute until these are resolved.

Bug 1: Em Dash Character in Docstring
File: services/tracking/tracker.py (Line 142)

Error: SyntaxError: invalid character '–' (U+2013)

Cause: An em dash (–) was used in a docstring instead of a standard hyphen (-), which causes Python's tokenizer to reject the file.

Fix: Replace the em dash – with a standard hyphen -.

Bug 2: Duplicate Merged Docstring
File: services/tracking/tracker.py (Lines 75–106)

Error: SyntaxError: unterminated triple-quoted string literal (detected at line 567)

Cause: Two separate docstrings for init were accidentally merged. The triple quotes """ on line 85 closed the string early, leaving the remaining text exposed as invalid, unquoted Python code. Consequently, the """ on line 106 opened a new string that swallowed the rest of the file's code.

Fix: Delete the first (shorter, duplicated) docstring block and keep only the complete, single docstring.

Bug 3: Case Sensitivity on Settings Attribute
File: scripts/inspect_tracks.py (Line 24)

Error: AttributeError: 'Settings' object has no attribute 'REDIS_URL'

Cause: The script attempts to call settings.REDIS_URL, but the Pydantic BaseSettings class in libs/config/settings.py normalizes this field name to lowercase (redis_url).

Fix: Update the attribute to lowercase:

Python

Change this:

settings.REDIS_URL

To this:

settings.redis_url

Steps to Reproduce

2.git clone
3.pip install -r services/tracking/requirements.txt
4.pytest tests/ -v

Expected Behavior

All 232 tests collected and run without import errors.

Actual Behavior

3 collection errors, 0 tests run.

Python Version

3.11

Operating System

Windows 11

Inference Device

None

Error Log / Traceback

Screenshots or Recordings

No response

Additional Context

No response

Checklist

  • I have searched existing issues and this is not a duplicate.
  • I have tested with the latest version of the main branch.

Metadata

Metadata

Assignees

Labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions