Skip to content

Commit

Permalink
ci: add pyright check
Browse files Browse the repository at this point in the history
  • Loading branch information
cole committed Jul 31, 2024
1 parent 9d7bb35 commit b4b3164
Show file tree
Hide file tree
Showing 2 changed files with 45 additions and 0 deletions.
2 changes: 2 additions & 0 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,9 @@ jobs:
- setup_venv:
install:
- run: python -m pip install mypy
- run: python -m pip install pyright
- run: python -m mypy src/aiosmtplib
- run: python -m pyright tests/pyright.py
security:
executor:
name: docker_executor
Expand Down
43 changes: 43 additions & 0 deletions tests/pyright.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
# pyright: strict

import email.message
import pathlib
import socket
import ssl

import aiosmtplib


async def send_str():
await aiosmtplib.send("test")


async def send_message():
message = email.message.EmailMessage()
await aiosmtplib.send(message)


async def send_all_options():
await aiosmtplib.send(
"test",
sender="test@example.com",
recipients=["user1@example.com"],
mail_options=["FOO"],
rcpt_options=["BAR"],
hostname="smtp.example.com",
port=1234,
username="root@example.com",
password="changeme",
local_hostname="test",
source_address=("foo", 123),
timeout=124.34,
use_tls=True,
start_tls=False,
validate_certs=False,
client_cert="test",
client_key="test",
tls_context=ssl.create_default_context(),
cert_bundle="test",
socket_path=pathlib.PurePath("/tmp/foo"),
sock=socket.socket(),
)

0 comments on commit b4b3164

Please sign in to comment.