def test_pip_error(tmpdir, capsys): req_in = tmpdir.join('req.in') req_in.write("non-existent") with pytest.raises(Abort): install_and_freeze(str(req_in)) out, err = capsys.readouterr() assert 'No distributions at all found for non-existent' in err
def test_install_and_freeze(req_in): pinned = install_and_freeze(req_in) stripped_reqs = [req.split('=')[0] for req in pinned] assert stripped_reqs == [ 'Flask', 'itsdangerous', 'Jinja2', 'MarkupSafe', 'Werkzeug', ]