diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml new file mode 100644 index 0000000..fabed9e --- /dev/null +++ b/.pre-commit-config.yaml @@ -0,0 +1,24 @@ +repos: + # - repo: local + # hooks: + # - id: tests + # name: run all tests that are not marked slow + # entry: python -m pytest -m "not slow" + # language: system + # language_version: default + # always_run: true + # pass_filenames: false + + - repo: https://github.com/pre-commit/mirrors-mypy + rev: '' # Use the sha / tag you want to point at + hooks: + - id: mypy + args: [--ignore-missing-imports] + + - repo: https://github.com/astral-sh/ruff-pre-commit + rev: v0.1.7 + hooks: + # Run the linter. + - id: ruff + # Run the formatter. + - id: ruff-format \ No newline at end of file diff --git a/pytest_abra/custom_fixtures.py b/pytest_abra/custom_fixtures.py index c5e8b6c..972b07e 100644 --- a/pytest_abra/custom_fixtures.py +++ b/pytest_abra/custom_fixtures.py @@ -3,7 +3,8 @@ import os import re -from datetime import datetime, timedelta + +# from datetime import datetime, timedelta from pathlib import Path from typing import Generator, Protocol, TypedDict @@ -93,7 +94,7 @@ def URL(env_config: dict[str, str]) -> BaseUrl: @pytest.fixture(scope="session") -def imap_client() -> Generator[Imbox]: +def imap_client() -> Generator[Imbox, None, None]: """imap email client using credentials from environment variables""" assert os.environ["IMAP_HOST"] @@ -138,9 +139,8 @@ def imap_recent_messages(imap_client: Imbox) -> list[Message]: for uid, message in messages: print(uid, message.subject, message.date)""" - N_MINUTES = 30 - - n_minutes_ago = datetime.now() - timedelta(minutes=N_MINUTES) + # N_MINUTES = 30 + # n_minutes_ago = datetime.now() - timedelta(minutes=N_MINUTES) uids: list[bytes] = [] messages: list[Message] = [] # for uid, message in imap_client.messages(date__gt=n_minutes_ago):