1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50
|
import subprocess
from pathlib import Path
from typing import Final
import pytest
_PYPROJECT1: Final = str(Path(__file__).parent / "test_configs" / "pyproject1.toml")
_PYPROJECT2: Final = str(Path(__file__).parent / "test_configs" / "pyproject2.toml")
_MYPYINI1: Final = str(Path(__file__).parent / "test_configs" / "mypy1.ini")
_MYPYINI2: Final = str(Path(__file__).parent / "test_configs" / "mypy2.ini")
_SETUPCFG1: Final = str(Path(__file__).parent / "test_configs" / "setup1.cfg")
_SETUPCFG2: Final = str(Path(__file__).parent / "test_configs" / "setup2.cfg")
_TEST_FILE: Final = str(Path(__file__).parent / "test-mypy-config.yml")
@pytest.mark.parametrize("config_file", [_PYPROJECT1, _PYPROJECT2])
def test_pyproject_toml(config_file: str) -> None:
subprocess.check_output(
[
"python3",
"-m",
"pytest",
"--mypy-pyproject-toml-file",
config_file,
_TEST_FILE,
]
)
@pytest.mark.parametrize(
"config_file",
[
_MYPYINI1,
_MYPYINI2,
_SETUPCFG1,
_SETUPCFG2,
],
)
def test_ini_files(config_file: str) -> None:
subprocess.check_output(
[
"python3",
"-m",
"pytest",
"--mypy-ini-file",
config_file,
_TEST_FILE,
]
)
|