Skip to content
This repository has been archived by the owner on Apr 26, 2024. It is now read-only.

Fix reported bugbear: too broad exception assertion #9753

Merged
merged 2 commits into from
Apr 6, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions changelog.d/9753.misc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Check that a `ConfigError` is raised, rather than simply `Exception`, when appropriate in homeserver config file generation tests.
5 changes: 3 additions & 2 deletions tests/config/test_load.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@

import yaml

from synapse.config import ConfigError
from synapse.config.homeserver import HomeServerConfig

from tests import unittest
Expand All @@ -35,9 +36,9 @@ def tearDown(self):

def test_load_fails_if_server_name_missing(self):
self.generate_config_and_remove_lines_containing("server_name")
with self.assertRaises(Exception):
with self.assertRaises(ConfigError):
HomeServerConfig.load_config("", ["-c", self.file])
with self.assertRaises(Exception):
with self.assertRaises(ConfigError):
HomeServerConfig.load_or_generate_config("", ["-c", self.file])

def test_generates_and_loads_macaroon_secret_key(self):
Expand Down