Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
jap opened this issue Oct 24, 2024 · 4 comments
Closed

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

jap opened this issue Oct 24, 2024 · 4 comments

Comments

@jap
Copy link
Contributor

jap commented Oct 24, 2024

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
Copy link
Member

CaselIT commented Oct 24, 2024

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
Copy link
Member

CaselIT commented Oct 24, 2024

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

@jap
Copy link
Contributor Author

jap commented Oct 24, 2024

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

@vytas7
Copy link
Member

vytas7 commented Oct 24, 2024

Resolved fixed in #2388.

@vytas7 vytas7 closed this as completed Oct 24, 2024
vytas7 added a commit to vytas7/falcon that referenced this issue Oct 27, 2024
vytas7 added a commit to vytas7/falcon that referenced this issue Nov 4, 2024
vytas7 added a commit that referenced this issue Nov 6, 2024
* chore: prepare 4.0.2 in-tree (WiP)

* chore: relabel #2387 as bugfix

* chore: aggregate 4.0.2 contributors

* chore: bump up version to `4.0.2`

* docs: slightly tweak newsfragment for #2387

* chore: aggregate contributors, +docs tweaks

* docs(ASGI): clean up docs on logging setup

* chore: render out newsfragments

* docs(typing); describe another limitation/inconsistency
@vytas7 vytas7 added this to the Version 4.0.2 milestone Nov 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants