microsoft/TypeAgent
Publicmirrored from https://github.com/microsoft/TypeAgentAvailable
python/ta/test/fixtures.py
19lines · modecode
| 1 | # Copyright (c) Microsoft Corporation. |
| 2 | # Licensed under the MIT License. |
| 3 | |
| 4 | import tempfile |
| 5 | |
| 6 | import pytest |
| 7 | |
| 8 | from typeagent.aitools import auth |
| 9 | |
| 10 | |
| 11 | @pytest.fixture(scope="session") |
| 12 | def needs_auth(): |
| 13 | auth.load_dotenv() |
| 14 | |
| 15 | |
| 16 | @pytest.fixture |
| 17 | def temp_dir(): |
| 18 | with tempfile.TemporaryDirectory() as dir: |
| 19 | yield dir |