Story: Fix test collection errors (nostr, telegram optional imports) #103

Closed
opened 2026-02-26 14:48:56 +00:00 by doxios · 0 comments
Collaborator

Epic: #101

Description

Nostr and telegram plugin tests fail to collect because they import modules (pynostr, telegram) at module level without guarding for optional dependencies.

Errors

  • nostr/tests/test_plugin.pyModuleNotFoundError: No module named 'pynostr'
  • telegram/tests/test_plugin.pyModuleNotFoundError: No module named 'telegram'

Acceptance Criteria

  • pytest --collect-only succeeds with no errors (all test files collected)
  • Tests that require optional deps are skipped gracefully with pytest.importorskip() or @pytest.mark.skipif
  • Tests still run and pass when the optional dependency IS installed
  • ruff check cobot/ passes
**Epic:** #101 ## Description Nostr and telegram plugin tests fail to collect because they import modules (`pynostr`, `telegram`) at module level without guarding for optional dependencies. ### Errors - `nostr/tests/test_plugin.py` — `ModuleNotFoundError: No module named 'pynostr'` - `telegram/tests/test_plugin.py` — `ModuleNotFoundError: No module named 'telegram'` ## Acceptance Criteria - [ ] `pytest --collect-only` succeeds with no errors (all test files collected) - [ ] Tests that require optional deps are skipped gracefully with `pytest.importorskip()` or `@pytest.mark.skipif` - [ ] Tests still run and pass when the optional dependency IS installed - [ ] `ruff check cobot/` passes
k9ert closed this issue 2026-02-26 15:45:38 +00:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
ultanio/cobot#103
No description provided.