"""Tests for exception handler.""" from unittest.mock import patch import pytest from artist import api from artist import config from artist import handlers # noqa (handlers are imported for test client) @pytest.fixture def fixture_client(): """Create an api test client fixture.""" return api.app.test_client() @patch('artist.logic.hello.health_check', side_effect=Exception()) def test_exception_handler(patch_check, fixture_client): """Test an uncaught Exception results in a 500 status code.""" result = fixture_client.get(config.HEALTH_CHECK) assert result.status_code == 500