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

Commit

Permalink
Fix reported bugbear: too broad exception assertion (#9753)
Browse files Browse the repository at this point in the history
  • Loading branch information
anoadragon453 authored Apr 6, 2021
1 parent 0ef321f commit 024f121
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
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

0 comments on commit 024f121

Please sign in to comment.