mirror of
https://github.com/simonw/datasette.git
synced 2025-12-10 16:51:24 +01:00
Fixed error message, closes #1816
This commit is contained in:
parent
df851c117d
commit
cb1e093fd3
2 changed files with 5 additions and 2 deletions
|
|
@ -295,7 +295,9 @@ class Datasette:
|
|||
# Validate those settings
|
||||
for key in settings:
|
||||
if key not in DEFAULT_SETTINGS:
|
||||
raise StartupError("Invalid setting '{key}' in settings.json")
|
||||
raise StartupError(
|
||||
"Invalid setting '{}' in settings.json".format(key)
|
||||
)
|
||||
self._settings = dict(DEFAULT_SETTINGS, **(settings or {}))
|
||||
self.renderers = {} # File extension -> (renderer, can_render) functions
|
||||
self.version_note = version_note
|
||||
|
|
|
|||
|
|
@ -86,8 +86,9 @@ def test_invalid_settings(config_dir):
|
|||
json.dumps({"invalid": "invalid-setting"}), "utf-8"
|
||||
)
|
||||
try:
|
||||
with pytest.raises(StartupError):
|
||||
with pytest.raises(StartupError) as ex:
|
||||
ds = Datasette([], config_dir=config_dir)
|
||||
assert ex.value.args[0] == "Invalid setting 'invalid' in settings.json"
|
||||
finally:
|
||||
(config_dir / "settings.json").write_text(previous, "utf-8")
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue