feat: aerich.Command support async with syntax (#427)
* feat: `aerich.Command` support `async with` syntax * docs: update readme
This commit is contained in:
11
tests/test_command.py
Normal file
11
tests/test_command.py
Normal file
@@ -0,0 +1,11 @@
|
||||
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 == []
|
||||
Reference in New Issue
Block a user