Beispiel #1
0
def test_should_build(req, need_wheel, disallow_binaries, expected):
    should_build = wheel_builder.should_build(
        req,
        need_wheel,
        check_binary_allowed=lambda req: not disallow_binaries,
    )
    assert should_build is expected
Beispiel #2
0
def test_should_cache(req, disallow_binaries, expected):
    def check_binary_allowed(req):
        return not disallow_binaries

    should_cache = wheel_builder.should_cache(req, check_binary_allowed)
    if not wheel_builder.should_build(
            req, need_wheel=False, check_binary_allowed=check_binary_allowed):
        # never cache if pip install (need_wheel=False) would not have built)
        assert not should_cache
    assert should_cache is expected