Skip to content

Commit

Permalink
Updates unit test to use assertRaisesRegex.
Browse files Browse the repository at this point in the history
  • Loading branch information
lisroach committed May 6, 2021
1 parent 23670b2 commit 0bff6fc
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions fixit/common/tests/test_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,8 @@
class TestConfig(UnitTest):
def test_validated_settings_with_bad_types(self) -> None:
bad_config = {"block_list_rules": False}
with self.assertRaises(ValidationError) as ex:
with self.assertRaisesRegex(ValidationError, "False is not of type 'array'"):
get_validated_settings(bad_config, Path("."))
self.assertIn("False is not of type 'array'", str(ex.exception))

def test_validated_settings_with_correct_types(self) -> None:
config = {"block_list_rules": ["FakeRule"]}
Expand Down

0 comments on commit 0bff6fc

Please sign in to comment.