mirror of
https://github.com/HKUDS/DeepTutor.git
synced 2026-12-02 04:49:39 +08:00
The fixture replaced the whole deeptutor.services.config package with a two-attribute stub. That was enough for the router's own import, but the websocket handler lazily imports deeptutor.api.routers.auth, which reads other loaders out of the same package — so the test only passed when an earlier test had already cached that module and the lazy import never reached the stub. On its own it failed with ImportError, and any change to test ordering could have flipped the full run red. Defer everything not deliberately overridden to the real module (PEP 562 module __getattr__), so the fake stays two lines wide and cannot rot as the auth path grows dependencies.