#!/usr/bin/env python

import sys
from subprocess import Popen, PIPE, STDOUT

try:
    import pytest_cov
    COVERAGE = True
except ImportError:
    COVERAGE = False

def main():
    cmd = ["py.test", "-x", "-r", "fsxX", "--ignore=tmp"]

    if COVERAGE:
        cmd.append("--cov=circuits")

    cmd.append("tests")

    Popen(cmd, stdout=sys.stdout, stderr=STDOUT).wait()

if __name__ == "__main__":
    main()
