falconry / falcon

The no-magic web data plane API and microservices framework for Python developers, with a focus on reliability, correctness, and performance at scale.
https://falcon.readthedocs.io/en/stable/
Apache License 2.0
9.51k stars 945 forks source link

falcon.testing.* is not (re-)exported #2387

Closed jap closed 32 minutes ago

jap commented 3 hours ago

Now that falcon 4 with type hints has been released 🎉 , we've enabled type checking using mypy as well for the falcon namespace for our codebase.

Unfortunately, falcon.testing.__init__ does not reexport the names it imports, which causes complaints by mypy, for example:

tests/test_subscription_data.py:13: error: Name "falcon.testing.TestClient" is not defined  [name-defined]

(PR will follow)

CaselIT commented 3 hours ago

Hi,

We are using __all__ to export the names from the inits, so the PR should use it instead of as ...

For example: https://github.com/falconry/falcon/blob/master/falcon/asgi/__init__.py

CaselIT commented 3 hours ago

@vytas7 I don't remember if there was a script that generated the __all__

jap commented 3 hours ago

I just generated one manually (that is, my editor did most of the work)

vytas7 commented 32 minutes ago

Resolved fixed in #2388.