# Path: pycc/pycompat.py
# class VERSION(object):
# PY2 = VERSION.major == 2
# PY25 = PY2 and VERSION.minor == 5
# PY26 = PY2 and VERSION.minor == 6
# PY27 = PY2 and VERSION.minor == 7
# PY3 = not PY2
# PY31 = PY3 and VERSION.minor == 1
# PY32 = PY3 and VERSION.minor == 2
# PY33 = PY3 and VERSION.minor == 3
# PY34 = PY3 and VERSION.minor == 4
# 
# Path: pycc/asttools/parse.py
# def parse(source, filename='<unknown>', mode='exec'):
#     """An ast.parse extension.
# 
#     This function behaves identically to the standard ast.parse except that it
#     adds parent and sibling references to each node.
#     """
#     node = ast.parse(source, filename, mode)
#     references.add_parent_references(node)
#     references.add_sibling_references(node)
# 
#     return node
# 
# Path: pycc/asttools/compiler.py
# def _code_to_bytecode_py2(code):
# def _code_to_bytecode_py3(code):
# def _code_to_bytecode_py34(code):
# def _code_to_bytecode(code):
#     def __call__(self, node, location='<AST>'):
#     def __call__(self, node):
# class ByteCodeCompiler(object):
# class SourceCodeCompiler(object):


import pytest
from pycc import pycompat
from pycc.asttools import parse
from pycc.asttools import compiler
"""Test suite for asttools.compiler."""

from __future__ import division
from __future__ import absolute_import
from __future__ import print_function
from __future__ import unicode_literals



source = """
x = True
for y in range(10):
    pass
"""


@pytest.fixture
def node():
    """Get as AST node from the source."""
    return parse.parse(source)


def test_bytecode_compiler(node):
    """Ensure that bytecode can be generated without errors."""
    compiler.ByteCodeCompiler()(node)


@pytest.mark.skipif(

# Path: pycc/pycompat.py
# class VERSION(object):
# PY2 = VERSION.major == 2
# PY25 = PY2 and VERSION.minor == 5
# PY26 = PY2 and VERSION.minor == 6
# PY27 = PY2 and VERSION.minor == 7
# PY3 = not PY2
# PY31 = PY3 and VERSION.minor == 1
# PY32 = PY3 and VERSION.minor == 2
# PY33 = PY3 and VERSION.minor == 3
# PY34 = PY3 and VERSION.minor == 4
# 
# Path: pycc/asttools/parse.py
# def parse(source, filename='<unknown>', mode='exec'):
#     """An ast.parse extension.
# 
#     This function behaves identically to the standard ast.parse except that it
#     adds parent and sibling references to each node.
#     """
#     node = ast.parse(source, filename, mode)
#     references.add_parent_references(node)
#     references.add_sibling_references(node)
# 
#     return node
# 
# Path: pycc/asttools/compiler.py
# def _code_to_bytecode_py2(code):
# def _code_to_bytecode_py3(code):
# def _code_to_bytecode_py34(code):
# def _code_to_bytecode(code):
#     def __call__(self, node, location='<AST>'):
#     def __call__(self, node):
# class ByteCodeCompiler(object):
# class SourceCodeCompiler(object):


# Path: tests/asttools/test_compiler.py
import pytest
from pycc import pycompat
from pycc.asttools import parse
from pycc.asttools import compiler

"""Test suite for asttools.compiler."""

from __future__ import division
from __future__ import absolute_import
from __future__ import print_function
from __future__ import unicode_literals



source = """
x = True
for y in range(10):
    pass
"""


@pytest.fixture
def node():
    """Get as AST node from the source."""
    return parse.parse(source)


def test_bytecode_compiler(node):
    """Ensure that bytecode can be generated without errors."""
    compiler.ByteCodeCompiler()(node)


@pytest.mark.skipif(

    pycompat.PY3 and pycompat.VERSION.minor > 3,