Skip to content

fix: --sharpit-app reports an uninspectable app as unknown, not as an empty pass - #276

Merged
ffroliva merged 11 commits into
release/0.8.0from
fix/0.8.0-e0-sharpit-app
Nov 22, 2026
Merged

ffroliva merged 11 commits into
release/0.8.0from
fix/0.8.0-e0-sharpit-app

Conversation

@ffroliva

Copy link
Copy Markdown
Owner

Summary

Carries #207 by @michaelegner onto release/0.8.0. --sharpit-app on an object whose routes cannot be read (a WSGI
app, an app wrapped in middleware, a coroutine returned by an async factory) now reports the API model as UNKNOWN,
with a masked reason, instead of an empty PASSED. An explicit FastAPI or Starlette app with no routes stays a
confirmed empty pass, and an APIRouter is no longer called as a factory.

  • The nine commits of fix: --sharpit-app reports an uninspectable app as unknown, not as an empty pass #207 are cherry-picked with -x; authorship and sign-offs are kept.
  • pytest_plugin/apps.py conflicted with the Flask handling added in 0.8.0. The resolution keeps the Flask path: the
    uninspectable check runs only for non-Flask apps, load_app never calls a Flask app, and an explicit Flask app with
    an unreadable URL map keeps its own reason.
  • The changelog entries move from the 0.7.0 section to Unreleased, credited to the contributor.

Supersedes #207, which is closed once this pull request merges.

Tests

The tests from #207 fail on release/0.8.0 without the fix (9 behaviour tests, for example
test_sharpit_app_uninspectable_app_fails_the_run_by_default and test_sharpit_app_router_is_assessed). A new test,
test_explicit_flask_app_with_a_route_map_is_assessed_not_uninspectable, fails with the Flask guard removed and
passes with it. The pytest plugin, FastAPI introspector and Flask tests pass, as do ruff, format, pyright and the
import-boundary, code-shape and citation checks.

michaelegner and others added 11 commits November 22, 2026 00:08
Signed-off-by: Michael Egner <m.egner@gmx.net>
(cherry picked from commit 7195b81)
Signed-off-by: Michael Egner <m.egner@gmx.net>
(cherry picked from commit c9b0a28)
Signed-off-by: Michael Egner <m.egner@gmx.net>
(cherry picked from commit f2be6a7)
Signed-off-by: Michael Egner <m.egner@gmx.net>
(cherry picked from commit b9384ea)
Signed-off-by: Michael Egner <m.egner@gmx.net>
(cherry picked from commit 779a4d7)
…test imports its module

Signed-off-by: Michael Egner <m.egner@gmx.net>
(cherry picked from commit daeb733)
…s annotations

Signed-off-by: Michael Egner <m.egner@gmx.net>
(cherry picked from commit d1149bc)
…changelog

Signed-off-by: Michael Egner <m.egner@gmx.net>
(cherry picked from commit d7da7e3)
Signed-off-by: Michael Egner <m.egner@gmx.net>
(cherry picked from commit d02ac08)
The two entries sat under 0.7.0; the fix ships in 0.8.0. Contributed by @michaelegner (#207).

Signed-off-by: Flavio Oliva <ffroliva@gmail.com>
…sed, not reported uninspectable

Signed-off-by: Flavio Oliva <ffroliva@gmail.com>
@ffroliva
ffroliva marked this pull request as ready for review November 22, 2026 00:32
@ffroliva
ffroliva merged commit b382215 into release/0.8.0 Nov 22, 2026
87 of 92 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants