main
 1import pytest
 2
 3import openai
 4from openai.lib._old_api import APIRemovedInV1
 5
 6
 7def test_basic_attribute_access_works() -> None:
 8    for attr in dir(openai):
 9        getattr(openai, attr)
10
11
12def test_helpful_error_is_raised() -> None:
13    with pytest.raises(APIRemovedInV1):
14        openai.Completion.create()  # type: ignore
15
16    with pytest.raises(APIRemovedInV1):
17        openai.ChatCompletion.create()  # type: ignore