def test_clp_build_precedence():
  with parser_pair() as (builder, parser):
    configure_clp_pex_resolution(parser, builder)
    assert builder._precedence == Sorter.DEFAULT_PACKAGE_PRECEDENCE

    parser.parse_args(args=['--no-build'])
    assert SourcePackage not in builder._precedence
    parser.parse_args(args=['--build'])
    assert SourcePackage in builder._precedence

    options, _ = parser.parse_args(args=['--no-wheel'])
    assert builder._precedence not in WheelPackage
    assert not options.use_wheel

    options, _ = parser.parse_args(args=['--wheel'])
    assert WheelPackage in builder._precedence
    assert options.use_wheel


# Make sure that we're doing append and not replace
dataset/ETHPy150Open pantsbuild/pex/tests/test_pex_binary.py/test_clp_build_precedence/swapped operands of `not in`