예제 #1
0
파일: run_all.py 프로젝트: Wkryst/Nuitka
            path, changed = convertUsing2to3(path)
        else:
            changed = True

        my_print("Consider", path, end = " ")

        command = [
            os.environ["PYTHON"],
            os.path.join("..", "..", "bin", "nuitka"),
            "--dump-xml",
            "--module",
            path
        ]

        result = check_output(
            command
        )

        # Parse the result into XML and check it.
        root = lxml.etree.fromstring(result)
        module_body = root[0]
        module_statements_sequence = module_body[0]

        assert len(module_statements_sequence) == 1
        module_statements = next(iter(module_statements_sequence))

        checkSequence(module_statements)

        if changed:
            os.unlink(path)
예제 #2
0
            os.environ["PYTHONPATH"] = python_path.strip()

            command.insert(2, "--must-not-re-execute")

            command = command[0:1] + [
                "-S",
                "-m",
                "coverage",
                "run",
                "--rcfile",
                os.devnull,
                "-a",
            ] + command[1:]

        result = check_output(command)

        # Parse the result into XML and check it.
        root = lxml.etree.fromstring(result)
        module_body = root[0]
        module_statements_sequence = module_body[0]

        assert len(module_statements_sequence) == 1
        module_statements = next(iter(module_statements_sequence))

        checkSequence(module_statements)

        if changed:
            os.unlink(filename)

        my_print("OK.")