aerich/tests/test_command.py
Waket Zheng e299f8e1d6
feat: aerich.Command support async with syntax (#427)
* feat: `aerich.Command` support `async with` syntax

* docs: update readme
2025-02-27 10:55:48 +08:00

12 lines
320 B
Python

from aerich import Command
from conftest import tortoise_orm
async def test_command(mocker):
mocker.patch("os.listdir", return_value=[])
async with Command(tortoise_orm) as command:
history = await command.history()
heads = await command.heads()
assert history == []
assert heads == []