conftest.py 531 B

1234567891011121314151617181920
  1. import os
  2. # Getting the absolute path of the current file's directory
  3. ABS_PATH = os.path.dirname(os.path.abspath(__file__))
  4. # Getting the absolute path of the project's root directory
  5. PROJECT_DIR = os.path.abspath(os.path.join(ABS_PATH, os.pardir, os.pardir))
  6. # Loading the .env file if it exists
  7. def _load_env() -> None:
  8. dotenv_path = os.path.join(PROJECT_DIR, "tests", "integration_tests", ".env")
  9. if os.path.exists(dotenv_path):
  10. from dotenv import load_dotenv
  11. load_dotenv(dotenv_path)
  12. _load_env()