<gh_stars>0
import subprocess


def test():
    """
    Run all unittests. Equivalent to:
    `poetry run python -u -m unittest discover`
    """
    subprocess.run(
        [
            "coverage",
            "run",
            "-m",
            "xmlrunner",
            "--output-file",
            "test-results.xml",
            "discover"
        ]
    )
    print("\n\nCode coverage results:")
    subprocess.run(["coverage", "report"])
    subprocess.run(["coverage", "xml"])


def lint():
    """
    Run the pylint linter.
    """
    subprocess.run(["pylint", "finance_pipeline", "test"])
