"""
Special configuration written to fix issues with the test suite of CPython.
"""

def setup_config(config):
    if 'pythonbin' in config.features:
        # pythonbin allows optimizations on non-BMP unicode strings, which
        # makes failing test_peepholer
        raise ValueError("pythonbin and cpython_tests features cannot be used together")
    if 'pythonenv' in config.features:
        raise ValueError("pythonenv and cpython_tests features cannot be used together")

    # CPython peephole optimizer uses a limit of 20: use the same limit
    # for test_peepholer
    config.max_string_length = 20

