aerich/tests/test_python_m.py
Waket Zheng 0364ae3f83
feat: add project section (#424)
* refactor: apply future style type hints

* chore: use project section

* ci: upgrade to poetry v2

* ci: explicit declare python version for poetry

* fix error for generate index name

* fix _generate_fk_name

* ci: verify aiomysql support

* tests: poetry add

* Add patch to fix tortoise 0.24.1

* docs: update changelog
2025-02-26 14:24:02 +08:00

19 lines
538 B
Python

import subprocess # nosec
from pathlib import Path
from aerich.version import __version__
from tests._utils import chdir, run_shell
def test_python_m_aerich():
assert __version__ in run_shell("python -m aerich --version")
def test_poetry_add(tmp_path: Path):
package = Path(__file__).parent.resolve().parent
with chdir(tmp_path):
subprocess.run(["poetry", "new", "foo"]) # nosec
with chdir("foo"):
r = subprocess.run(["poetry", "add", package]) # nosec
assert r.returncode == 0