Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions src/copilot_usage/interactive.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
from rich.console import Console
from rich.table import Table
from rich.text import Text
from watchdog.observers import Observer

from copilot_usage import __version__
from copilot_usage.models import SessionSummary
Expand Down Expand Up @@ -132,8 +133,6 @@ def start_observer(
treat a ``None`` return as "auto-refresh unavailable" and continue
without it.
"""
from watchdog.observers import Observer

handler: FileChangeEventHandler = FileChangeHandler(change_event)
observer = Observer()
observer.schedule(handler, str(session_path), recursive=True) # pyright: ignore[reportArgumentType]
Expand Down
12 changes: 12 additions & 0 deletions tests/copilot_usage/test_interactive.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
"""Tests for copilot_usage.interactive module."""

import copilot_usage.interactive as _interactive_mod
from watchdog.observers import Observer


Comment on lines +3 to +6
def test_watchdog_observer_imported_at_module_level() -> None:
"""Observer must be importable as a module-level attribute, not deferred."""
assert hasattr(_interactive_mod, "Observer"), (
"Observer should be imported at module level in interactive.py"
)
assert _interactive_mod.Observer is Observer
Loading