chore(tests): remove stale tests/test_init.py::test_router — cookiecutter leftover, always-failing #34

Closed
opened 2026-05-31 17:23:01 +00:00 by padreug · 0 comments
Owner

Problem

tests/test_init.py::test_router has been failing for the lifetime of the repo:

@pytest.mark.asyncio
async def test_router():
    router = APIRouter()
    router.include_router(satmachineadmin_ext)

It originated from the LNBits extension cookiecutter scaffold (commit 42b5eda, Aug 2024, authored upstream by dni ⚡). Two reasons it can never pass under the current test setup:

  1. No pytest-asyncio plugin in the lnbits test runner. The project deliberately doesn't ship it — the documented workaround across our newer tests is asyncio.run inside the test body (see tests/test_cassette_state_consumer.py header). The @pytest.mark.asyncio decorator is a no-op here, and pytest doesn't know how to run an async def test without a plugin.
  2. The test asserts nothing meaningful. It constructs an APIRouter and calls include_router — any failure mode would already surface at extension boot. The cassette consumer tests + the resolver tests already exercise the package's __init__.py import path transitively.

Why fix

Every test run shows:

==== 1 failed, 161 passed, 1 warning in 1.12s ====
FAILED tests/test_init.py::test_router

…which trains the eye to ignore the failure line. Cost: lower baseline-noise gate for spotting a real regression next time something breaks.

Fix

Delete the file. Coverage of "the satmachineadmin router can be imported + included" is provided by:

  • Extension boot smoke (every dev container restart loads the router via from .views_api import satmachineadmin_api_router)
  • Every other test file in tests/ that imports from .. (which triggers package __init__.py execution)

PR coming as a sibling chore to keep the issue open-to-merge window short.

Refs

  • Origin commit: 42b5eda (feat: code quality, upstream cookiecutter port)
  • Workaround pattern: tests/test_cassette_state_consumer.py:20-23 header
  • Discovered: 2026-05-31 during feat/roster-resolver test-suite verification (coord-log §17:25Z)
## Problem `tests/test_init.py::test_router` has been failing for the lifetime of the repo: ```python @pytest.mark.asyncio async def test_router(): router = APIRouter() router.include_router(satmachineadmin_ext) ``` It originated from the LNBits extension cookiecutter scaffold (commit `42b5eda`, Aug 2024, authored upstream by `dni ⚡`). Two reasons it can never pass under the current test setup: 1. **No `pytest-asyncio` plugin in the lnbits test runner.** The project deliberately doesn't ship it — the documented workaround across our newer tests is `asyncio.run` inside the test body (see `tests/test_cassette_state_consumer.py` header). The `@pytest.mark.asyncio` decorator is a no-op here, and pytest doesn't know how to run an `async def` test without a plugin. 2. **The test asserts nothing meaningful.** It constructs an APIRouter and calls `include_router` — any failure mode would already surface at extension boot. The cassette consumer tests + the resolver tests already exercise the package's `__init__.py` import path transitively. ## Why fix Every test run shows: ``` ==== 1 failed, 161 passed, 1 warning in 1.12s ==== FAILED tests/test_init.py::test_router ``` …which trains the eye to ignore the failure line. Cost: lower baseline-noise gate for spotting a real regression next time something breaks. ## Fix Delete the file. Coverage of "the satmachineadmin router can be imported + included" is provided by: - Extension boot smoke (every dev container restart loads the router via `from .views_api import satmachineadmin_api_router`) - Every other test file in `tests/` that imports from `..` (which triggers package `__init__.py` execution) PR coming as a sibling chore to keep the issue open-to-merge window short. ## Refs - Origin commit: `42b5eda` (`feat: code quality`, upstream cookiecutter port) - Workaround pattern: `tests/test_cassette_state_consumer.py:20-23` header - Discovered: 2026-05-31 during `feat/roster-resolver` test-suite verification (coord-log §17:25Z)
Sign in to join this conversation.
No labels
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
aiolabs/satmachineadmin#34
No description provided.