clan-cli: enable mypy for tests

This commit is contained in:
DavHau
2023-07-21 13:34:35 +02:00
parent a05c550b41
commit e806b5549d
4 changed files with 8 additions and 10 deletions

View File

@@ -1,16 +1,20 @@
import argparse
from typing import Union
import pytest_subprocess.fake_process
from pytest_subprocess import utils
from clan_cli import admin
def test_make_parser():
def test_make_parser() -> None:
parser = argparse.ArgumentParser()
admin.register_parser(parser)
# using fp fixture from pytest-subprocess
def test_create(fp):
cmd = ["nix", "flake", "init", "-t", fp.any()]
def test_create(fp: pytest_subprocess.fake_process.FakeProcess) -> None:
cmd: list[Union[str, utils.Any]] = ["nix", "flake", "init", "-t", fp.any()]
fp.register(cmd)
args = argparse.Namespace(folder="./my-clan")
admin.create(args)