FAQ and Troubleshooting¶
Why are my lazy imports not in __all__?¶
By default, Monkay updates __all__ when lazy imports are registered.
If you pass skip_all_update=True, update manually with update_all_var(...).
Why does monkay.settings raise UnsetError?¶
Settings are disabled (settings_path=None/False/"") or the active settings
callable returned None.
Why did evaluate_settings() return False?¶
You likely used ignore_import_errors=True and settings resolution failed.
Run again with ignore_import_errors=False to expose the underlying exception.
Why does extension registration fail with ValueError?¶
- The object does not satisfy
ExtensionProtocol, or on_conflictis not one oferror,keep,replace.
How do I debug export mismatches?¶
Use find_missing(...) from a configured module:
How do I avoid state leakage in tests?¶
- Prefer
with_settings,with_extensions,with_instance, andwith_full_overwrite. - Clean dynamically imported modules from
sys.modulesin test fixtures. - Keep global mutable state inside cages or explicit fixtures.