conftest.py 380 B

1234567891011121314151617181920212223
  1. import os
  2. import pytest
  3. def clean_db():
  4. db_path = os.path.expanduser("~/.embedchain/embedchain.db")
  5. if os.path.exists(db_path):
  6. os.remove(db_path)
  7. @pytest.fixture
  8. def setup():
  9. clean_db()
  10. yield
  11. clean_db()
  12. @pytest.fixture(autouse=True)
  13. def disable_telemetry():
  14. os.environ["EC_TELEMETRY"] = "false"
  15. yield
  16. del os.environ["EC_TELEMETRY"]