# Path: mako/testing/_config.py
# class ConfigValueTypeError(ConfigError):
#     pass
# 
# Path: mako/testing/_config.py
# class MissingConfig(ConfigError):
#     pass
# 
# Path: mako/testing/_config.py
# class MissingConfigItem(ConfigError):
#     pass
# 
# Path: mako/testing/_config.py
# class MissingConfigSection(ConfigError):
#     pass
# 
# Path: mako/testing/_config.py
# class ReadsCfg:
#     section_header: ClassVar[str]
#     converters: ClassVar[Optional[dict]] = None
# 
#     @classmethod
#     def from_cfg_file(cls, filespec: Union[Path, str]):
#         cfg = _parse_cfg_file(filespec)
#         dispatch = _build_getter_dispatch(
#             cfg, cls.section_header, converters=cls.converters
#         )
#         kwargs = {
#             field.name: dispatch.get_typed_value(field.type, field.name)
#             for field in dataclasses.fields(cls)
#         }
#         return cls(**kwargs)
# 
# Path: mako/testing/assertions.py
# def assert_raises_message_with_given_cause(
#     except_cls, msg, cause_cls, callable_, *args, **kwargs
# ):
#     return _assert_raises(
#         except_cls, callable_, args, kwargs, msg=msg, cause_cls=cause_cls
#     )
# 
# Path: mako/testing/assertions.py
# def assert_raises_with_given_cause(
#     except_cls, cause_cls, callable_, *args, **kw
# ):
#     return _assert_raises(except_cls, callable_, args, kw, cause_cls=cause_cls)


import configparser
import pytest
from dataclasses import dataclass
from datetime import datetime
from decimal import Decimal
from pathlib import Path
from mako.testing._config import ConfigValueTypeError
from mako.testing._config import MissingConfig
from mako.testing._config import MissingConfigItem
from mako.testing._config import MissingConfigSection
from mako.testing._config import ReadsCfg
from mako.testing.assertions import assert_raises_message_with_given_cause
from mako.testing.assertions import assert_raises_with_given_cause



PATH_TO_TEST_CONFIG = Path(__file__).parent / "dummy.cfg"


@dataclass
class BasicConfig(ReadsCfg):
    int_value: int
    bool_value: bool
    float_value: float
    str_value: str

    section_header = "basic_values"


@dataclass

# Path: mako/testing/_config.py
# class ConfigValueTypeError(ConfigError):
#     pass
# 
# Path: mako/testing/_config.py
# class MissingConfig(ConfigError):
#     pass
# 
# Path: mako/testing/_config.py
# class MissingConfigItem(ConfigError):
#     pass
# 
# Path: mako/testing/_config.py
# class MissingConfigSection(ConfigError):
#     pass
# 
# Path: mako/testing/_config.py
# class ReadsCfg:
#     section_header: ClassVar[str]
#     converters: ClassVar[Optional[dict]] = None
# 
#     @classmethod
#     def from_cfg_file(cls, filespec: Union[Path, str]):
#         cfg = _parse_cfg_file(filespec)
#         dispatch = _build_getter_dispatch(
#             cfg, cls.section_header, converters=cls.converters
#         )
#         kwargs = {
#             field.name: dispatch.get_typed_value(field.type, field.name)
#             for field in dataclasses.fields(cls)
#         }
#         return cls(**kwargs)
# 
# Path: mako/testing/assertions.py
# def assert_raises_message_with_given_cause(
#     except_cls, msg, cause_cls, callable_, *args, **kwargs
# ):
#     return _assert_raises(
#         except_cls, callable_, args, kwargs, msg=msg, cause_cls=cause_cls
#     )
# 
# Path: mako/testing/assertions.py
# def assert_raises_with_given_cause(
#     except_cls, cause_cls, callable_, *args, **kw
# ):
#     return _assert_raises(except_cls, callable_, args, kw, cause_cls=cause_cls)


# Path: test/testing/test_config.py
import configparser
import pytest
from dataclasses import dataclass
from datetime import datetime
from decimal import Decimal
from pathlib import Path
from mako.testing._config import ConfigValueTypeError
from mako.testing._config import MissingConfig
from mako.testing._config import MissingConfigItem
from mako.testing._config import MissingConfigSection
from mako.testing._config import ReadsCfg
from mako.testing.assertions import assert_raises_message_with_given_cause
from mako.testing.assertions import assert_raises_with_given_cause




PATH_TO_TEST_CONFIG = Path(__file__).parent / "dummy.cfg"


@dataclass
class BasicConfig(ReadsCfg):
    int_value: int
    bool_value: bool
    float_value: float
    str_value: str

    section_header = "basic_values"


@dataclass

class BooleanConfig(ReadsCfg):