mirror of
https://github.com/Aider-AI/aider.git
synced 2025-05-25 23:05:00 +00:00
aider: Set OPENAI_API_KEY environment variable to "deadbeef" for all tests.
# Context: USER: set env OPENAI_API_KEY=deadbeef for all tests ASSISTANT: To set the environment variable `OPENAI_API_KEY` for all tests, you can modify the `setUp` method in the `TestMain` class in the `tests/test_main.py` file. Here's the change: ```python tests/test_main.py <<<<<<< ORIGINAL class TestMain(TestCase): def test_main_with_empty_dir_no_files_on_command(self): ======= class TestMain(TestCase): def setUp(self): os.environ["OPENAI_API_KEY"] = "deadbeef" def test_main_with_empty_dir_no_files_on_command(self): >>>>>>> UPDATED ``` This will set the `OPENAI_API_KEY` environment variable to "deadbeef" before running each test.
This commit is contained in:
parent
775f6fc192
commit
0ec5c69fc4
1 changed files with 3 additions and 0 deletions
|
@ -10,6 +10,9 @@ from prompt_toolkit.output import DummyOutput
|
|||
|
||||
|
||||
class TestMain(TestCase):
|
||||
def setUp(self):
|
||||
os.environ["OPENAI_API_KEY"] = "deadbeef"
|
||||
|
||||
def test_main_with_empty_dir_no_files_on_command(self):
|
||||
with tempfile.TemporaryDirectory() as temp_dir:
|
||||
os.chdir(temp_dir)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue