def test_check_stopped_timeout(): content = "some_status" error = "" with pytest.raises(TimeoutError) as excinfo: with patch("requests.get", side_effect=lambda url: mocked_status_get( url, content, error)): check_stopped(wait=.1, max_retries=1) assert "check_stopped() timed out" == str(excinfo.value)
def test_check_stopped(): with patch("requests.get", side_effect=mock_exception): check_stopped(wait=0.1, max_retries=1)