Skip to content

Commit 531565d

Browse files
lesnik512claude
andauthored
test: lock in instance-attribute reads in api_bootstrapper_config (#57)
Port the regression test from litestar-sqlalchemy-template#32. The production bug fixed there (api_bootstrapper_config reading the module -global `settings` singleton instead of `self`) is already absent here, but there was no test guarding against it being reintroduced. The test constructs a non-singleton Settings instance and asserts its api_bootstrapper_config reflects that instance, not the global. Co-authored-by: Claude Opus 4.8 (1M context) <[email protected]>
1 parent 19ca197 commit 531565d

1 file changed

Lines changed: 10 additions & 0 deletions

File tree

tests/test_settings.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
from app.settings import Settings
2+
3+
4+
def test_api_bootstrapper_config_reads_instance_not_global() -> None:
5+
custom = Settings(service_name="custom-service", service_version="9.9.9")
6+
7+
config = custom.api_bootstrapper_config
8+
9+
assert config.service_name == "custom-service"
10+
assert config.service_version == "9.9.9"

0 commit comments

Comments
 (0)