def test_load_exception(): with pytest.raises(ConfigException): with patch('ssb.util.open', mock_open(read_data=CONFIG_FILE_INVALID), create=True): load_ssb_secret()