INNER CODE UNIT · Python

test_pip_error

logandk/serverless-wsgi · requirements_test.py:212

def test_pip_error(mock_system, mock_virtualenv, monkeypatch):
    monkeypatch.setattr(subprocess, "Popen", lambda *args, **kwargs: PopenStub(1))

    with pytest.raises(SystemExit):
        requirements.package(["/path1/requirements.txt"], "/tmp")


def test_package_with_pip_args(mock_system, mock_virtualenv):
    requirements.package(
        ["/path1/requirements.txt"],
        "/tmp",
        "--no-deps --imaginary-arg 'imaginary \"value\"'",
    )

    # Invokes pip for package installation
    assert mock_system[15] == (
        "subprocess.Popen",
        (

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…