Coverage for src/jsoncrack_for_sphinx/utils/__init__.py: 88%

8 statements  

« prev     ^ index     » next       coverage.py v7.10.0, created at 2025-07-24 22:26 +0000

1"""Utility functions and common types.""" 

2 

3# Import fixtures directly without going through other modules 

4from .fixtures import ( 

5 create_function_schema, 

6 create_method_schema, 

7 create_option_schema, 

8) 

9 

10# Export all public functions 

11__all__ = [ 

12 "create_function_schema", 

13 "create_method_schema", 

14 "create_option_schema", 

15] 

16 

17 

18from typing import Any 

19 

20 

21def __getattr__(name: str) -> Any: 

22 """Lazy import for backward compatibility.""" 

23 if name == "schema_to_rst": 

24 from ..generators.rst_generator import schema_to_rst 

25 

26 return schema_to_rst 

27 raise AttributeError(f"module '{__name__}' has no attribute '{name}'")