# Path: tinycsscheme/tinycss/tokenizer.py
# def tokenize_flat(css_source, ignore_comments=True,
#     # Make these local variable to avoid global lookups in the loop
#     tokens_dispatch=token_data.TOKEN_DISPATCH,
#     unicode_unescape=token_data.UNICODE_UNESCAPE,
#     newline_unescape=token_data.NEWLINE_UNESCAPE,
#     simple_unescape=token_data.SIMPLE_UNESCAPE,
#     find_newlines=token_data.FIND_NEWLINES,
#     Token=token_data.Token,
#     len=len,
#     int=int,
#     float=float,
#     list=list,
#     _None=None,
# ):
# def regroup(tokens):
#     def _regroup_inner(stop_at=None,
#             tokens=tokens, pairs=pairs, eof=eof,
#             ContainerToken=token_data.ContainerToken,
#             FunctionToken=token_data.FunctionToken):
# def tokenize_grouped(css_source, ignore_comments=True):


import sys
import os
import pytest
from ..tokenizer import (
    python_tokenize_flat, cython_tokenize_flat, regroup)
# coding: utf8
"""
    Tests for the tokenizer
    -----------------------

    :copyright: (c) 2012 by Simon Sapin.
    :license: BSD, see LICENSE for more details.
"""


from __future__ import unicode_literals





def test_speedups():
    if os.environ.get('TINYCSS_SKIP_SPEEDUPS_TESTS'):  # pragma: no cover
        return
    assert cython_tokenize_flat is not None, (
        'Cython speedups are not installed, related tests will '
        'be skipped. Set the TINYCSS_SKIP_SPEEDUPS_TESTS environment '
        'variable if this is expected (eg. on PyPy).')


@pytest.mark.parametrize(('tokenize', 'css_source', 'expected_tokens'), [
  (tokenize,) + test_data

# Path: tinycsscheme/tinycss/tokenizer.py
# def tokenize_flat(css_source, ignore_comments=True,
#     # Make these local variable to avoid global lookups in the loop
#     tokens_dispatch=token_data.TOKEN_DISPATCH,
#     unicode_unescape=token_data.UNICODE_UNESCAPE,
#     newline_unescape=token_data.NEWLINE_UNESCAPE,
#     simple_unescape=token_data.SIMPLE_UNESCAPE,
#     find_newlines=token_data.FIND_NEWLINES,
#     Token=token_data.Token,
#     len=len,
#     int=int,
#     float=float,
#     list=list,
#     _None=None,
# ):
# def regroup(tokens):
#     def _regroup_inner(stop_at=None,
#             tokens=tokens, pairs=pairs, eof=eof,
#             ContainerToken=token_data.ContainerToken,
#             FunctionToken=token_data.FunctionToken):
# def tokenize_grouped(css_source, ignore_comments=True):


# Path: tinycsscheme/tinycss/tests/test_tokenizer.py
import sys
import os
import pytest
from ..tokenizer import (
    python_tokenize_flat, cython_tokenize_flat, regroup)

# coding: utf8
"""
    Tests for the tokenizer
    -----------------------

    :copyright: (c) 2012 by Simon Sapin.
    :license: BSD, see LICENSE for more details.
"""


from __future__ import unicode_literals





def test_speedups():
    if os.environ.get('TINYCSS_SKIP_SPEEDUPS_TESTS'):  # pragma: no cover
        return
    assert cython_tokenize_flat is not None, (
        'Cython speedups are not installed, related tests will '
        'be skipped. Set the TINYCSS_SKIP_SPEEDUPS_TESTS environment '
        'variable if this is expected (eg. on PyPy).')


@pytest.mark.parametrize(('tokenize', 'css_source', 'expected_tokens'), [
  (tokenize,) + test_data

  for tokenize in (python_tokenize_flat, cython_tokenize_flat)