conftest.py 400 B

123456789101112131415161718
  1. import io
  2. import pathlib
  3. import typing
  4. import pytest
  5. @pytest.fixture
  6. def temp_dir_path(tmpdir) -> pathlib.Path:
  7. return pathlib.Path(tmpdir)
  8. @pytest.fixture
  9. def google_calendar_file() -> typing.Iterator[io.BufferedReader]:
  10. with pathlib.Path(__file__).parent.joinpath(
  11. "resources", "google-calendar.ics"
  12. ).open("rb") as file:
  13. yield typing.cast(io.BufferedReader, file)