Repository navigation
Conversation
|
I put together a small retained-view regression to go with this fix. It creates a nested view before reloading, removes the environment override and checks that both the retained view and a fresh lookup see the lower-priority fallback. It then recreates the override and checks the retained view again. The test fails at the fallback assertion on If useful, you could add it alongside the source-level reload tests to cover callers that keep a view around. Happy for you to take it or leave it. |
Adapt the retained-view regression supplied by @carlitogwapito in commit 11e83d9 into the existing parameterized environment tests. Verify fallback and replacement values through both retained and fresh views, while preserving the source object. Source: beetbox/confuse#221 (comment)
|
Thanks @carlitogwapito. Adapted your regression from 11e83d9 into the existing parameterized environment tests in 6f217df, with credit in the commit message. It keeps the same nested view through 4001 → fallback 4000 → 4002 in both parsing modes, and checks fresh lookups and source identity after each reload. Confirmed that both your original test and the adaptation fail on bf42783 and pass with the fix. On Python 3.12.14 / PyYAML 6.0.3: all 45 environment tests pass; the full suite has 309 passes and the same date-dependent release-helper failure reproduced on the unchanged base. Production code and Configuration.reload() are unchanged. |
EnvSource.load()updates its existing dictionary without removing keys absent from the new environment. After deleting an environment override and explicitly reloading the source, the deleted value continues to mask lower-priority defaults. Removing all matching variables leaves the entire old source intact.Clear the source only after the complete replacement environment has been parsed and transformed successfully, then update the same source object. Parsing failures still preserve previous contents.
Configuration.reload()remains unchanged and continues to reload YAML sources only.Regression coverage checks removed overrides and fallback values, missing keys, deletion/recreation, nested values, source identity and settings, ordering with separators disabled, both scalar/full-YAML parsing modes, and preservation on a failed parse.
Validation on Python 3.12.14 against main bf42783:
Remote Test and Lint workflows for ef0648a are
action_required, awaiting maintainer approval, with zero jobs executed. Remote CI has not passed.Prepared and checked with OpenAI Codex assistance.