예제 #1
0
def test():
    """Run all tests.

    :return: a :class:`unittest.TestResult` object
    """
    from .testsuite import run
    return run()
예제 #2
0
def test():
    """Run all tests.

    :return: a :class:`unittest.TestResult` object
    """
    from .testsuite import run
    return run()
예제 #3
0
파일: lint.py 프로젝트: IzunaDevs/SnekChek
    def run(self, _):  # type: (typing.List[str]) -> None

        if sys.version_info >= (3, 0, 0):
            t = io.StringIO
        else:
            t = io.BytesIO

        file = t()
        with redirect_stdout(file), redirect_stderr(file):
            # Import pyroma here because it uses logging and sys.stdout
            import pyroma  # noqa pylint: disable=all

            pyroma.run("directory", ".")
        file.seek(0)

        text = file.read()

        lines = text.split("\n")
        lines.pop(0)
        if sys.version_info >= (3, 0, 0):
            lines.pop(0)

        data = {"modules": {}}

        module = lines.pop(0)[6:].strip()
        data["modules"][module] = []
        lines.pop(0)
        if len(lines) >= 6:
            line = lines.pop(0)
            while line != "-" * 30:
                data["modules"][module].append(line)
                line = lines.pop(0)

        rating = lines.pop(0)
        data["rating"] = int(rating[14:-3])
        data["rating_word"] = lines.pop(0)

        self.status_code = 0 if data["rating"] == 10 else 1

        if data["rating"] == 10:
            data = []

        self.hook(data)
예제 #4
0
파일: __init__.py 프로젝트: ignamv/lantz
def run_pyroma(data):
    import sys
    from zest.releaser.utils import ask
    if not ask("Run pyroma on the package before uploading?"):
        return
    try:
        from pyroma import run
        result = run(data['tagdir'])
        if result != 10:
            if not ask("Continue?"):
                sys.exit(1)
    except ImportError:
        if not ask("pyroma not available. Continue?"):
            sys.exit(1)
예제 #5
0
파일: __init__.py 프로젝트: paopaoai11/VyPy
def run_pyroma(data):
    import sys
    from zest.releaser.utils import ask
    if not ask("Run pyroma on the package before uploading?"):
        return
    try:
        from pyroma import run
        result = run(data['tagdir'])
        if result != 10:
            if not ask("Continue?"):
                sys.exit(1)
    except ImportError:
        if not ask("pyroma not available. Continue?"):
            sys.exit(1)
예제 #6
0
파일: lint.py 프로젝트: ry00001/SnekChek
    def run(self, _: list) -> None:
        file = io.StringIO()
        with redirect_stdout(file), redirect_stderr(io.StringIO()):
            # Import pyroma here because it uses logging and sys.stdout
            import pyroma  # noqa pylint: disable=all
            pyroma.run('directory', '.')
        file.seek(0)

        text = file.read()

        lines = text.split("\n")

        lines.pop(0)
        lines.pop(0)

        data = {'modules': {}}

        module = lines.pop(0)[6:].strip()
        data['modules'][module] = []
        lines.pop(0)
        if len(lines) >= 6:
            line = lines.pop(0)
            while line != "-" * 30:
                data['modules'][module].append(line)
                line = lines.pop(0)

        rating = lines.pop(0)
        data['rating'] = int(rating[14:-3])
        data['rating_word'] = lines.pop(0)

        self.status_code = 0 if data['rating'] == 10 else 1

        if data['rating'] == 10:
            data = []

        self.hook(data)
예제 #7
0
def _run_pyroma(data):   # pragma: no cover
    """Run pyroma (used to perform checks before releasing a new version).
    """
    import sys
    from zest.releaser.utils import ask
    if not ask("Run pyroma on the package before uploading?"):
        return
    try:
        from pyroma import run
        result = run(data['tagdir'])
        if result != 10:
            if not ask("Continue?"):
                sys.exit(1)
    except ImportError:
        if not ask("pyroma not available. Continue?"):
            sys.exit(1)
예제 #8
0
def _run_pyroma(data):  # pragma: no cover
    """Run pyroma (used to perform checks before releasing a new version).
    """
    import sys
    from zest.releaser.utils import ask
    if not ask("Run pyroma on the package before uploading?"):
        return
    try:
        from pyroma import run
        result = run(data['tagdir'])
        if result != 10:
            if not ask("Continue?"):
                sys.exit(1)
    except ImportError:
        if not ask("pyroma not available. Continue?"):
            sys.exit(1)
예제 #9
0
파일: env.py 프로젝트: BeryJu/supervisr
def pyroma(ctx):
    """Check setup.py"""
    from pyroma import run
    run('directory', '.')