File tree Expand file tree Collapse file tree 1 file changed +9
-6
lines changed
Expand file tree Collapse file tree 1 file changed +9
-6
lines changed Original file line number Diff line number Diff line change @@ -28,18 +28,21 @@ def test_runtime_coerce_float_inverted_flag(monkeypatch):
2828
2929
3030def test_coerce_float_picks_up_late_env_after_cache_clear (monkeypatch ):
31- # Config cached before DEEPNOTE_DO_NOT_COERCE_FLOAT is set → stale.
32- # After clear_config_cache(), next get_config() sees the new value.
31+ # Setup: start from a clean cache and confirm the default value
3332 clear_config_cache ()
3433 monkeypatch .delenv ("DEEPNOTE_DO_NOT_COERCE_FLOAT" , raising = False )
34+ cfg_default = get_config ()
35+ assert cfg_default .runtime .coerce_float is True
3536
36- assert get_config ().runtime .coerce_float is True
37-
37+ # Inject the env var; the cached config should still return the default
3838 monkeypatch .setenv ("DEEPNOTE_DO_NOT_COERCE_FLOAT" , "1" )
39- assert get_config ().runtime .coerce_float is True # stale
39+ cfg_cached = get_config ()
40+ assert cfg_cached .runtime .coerce_float is True
4041
42+ # After clearing the cache, the config should pick up the injected value
4143 clear_config_cache ()
42- assert get_config ().runtime .coerce_float is False
44+ cfg_refreshed = get_config ()
45+ assert cfg_refreshed .runtime .coerce_float is False
4346
4447
4548def test_loader_precedence_cli_over_env_over_file (tmp_path , monkeypatch ):
You can’t perform that action at this time.
0 commit comments