code: def test_from_dict_fail_wo_env_var(self, monkeypatch):
      monkeypatch.delenv("OPENAI_API_KEY", raising=False)
      data = {
          "type": "haystack.components.generators.chat.openai.OpenAIChatGenerator",
          "init_parameters": {
              "model": "gpt-4",
              "organization": None,
              "api_base_url": "test-base-url",
              "streaming_callback": "haystack.components.generators.utils.default_streaming_callback",
              "generation_kwargs": {
                  "max_tokens": 10,
                  "some_test_param": "test-params",
              },
          },
      }
      with pytest.raises(OpenAIError):
          OpenAIChatGenerator.from_dict(data)
  
imports: import os
  import pytest
  from openai import OpenAIError
  from haystack.components.generators.chat import OpenAIChatGenerator
  from haystack.components.generators.utils import default_streaming_callback
  from haystack.dataclasses import ChatMessage, StreamingChunk
label_desc: Use image node_id 8 for calling the TestOpenAIChatGenerator obj's underlying member method code with example usage: obj.test_from_dict_fail_wo_env_var(monkeypatch) without return types