How to use pipupgrade - 10 common examples

To help you get started, we’ve selected a few pipupgrade examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github achillesrasquinha / pipupgrade / tests / pipupgrade / test__pip.py View on Github external
if output:
                    assert rout
                else:
                    assert not rout
            else:
                assert rout == output

        _assert_outerr(rout, output)
        _assert_outerr(rerr, err)

    directory = tmpdir.mkdir("tmp")
    tempfile  = directory.join("tmp.log")
    path      = str(tempfile)

    _pip.call("install", "pipupgrade")
    assert_pip_call(_pip.call("install", "pipupgrade", quiet = True))
    
    _pip.call("install", "pipupgrade", log = path)
    assert tempfile.read()
github achillesrasquinha / pipupgrade / tests / pipupgrade / cli / test_cli_util.py View on Github external
def _assert_confirm(stdout):
        assert_input(capfd, query, "Y", expected = True,  input_ = cli.confirm, stdout = stdout)
        assert_input(capfd, query, "y", expected = True,  input_ = cli.confirm, stdout = stdout)
        assert_input(capfd, query,"\n", expected = True,  input_ = cli.confirm, stdout = stdout)
        assert_input(capfd, query, "n", expected = False, input_ = cli.confirm, stdout = stdout)
        assert_input(capfd, query, "1", expected = False, input_ = cli.confirm, stdout = stdout)
github achillesrasquinha / pipupgrade / tests / pipupgrade / cli / test_cli__init__.py View on Github external
        @cli.command
        def foobar(*args, **kwargs):
            args    = get_args()
            params  = merge_dict(args, override)
            
            for k, v in iteritems(values):
                assert params[k] == v

            if initial:
                for k in iterkeys(initial):
                    assert initial[k] == args[k]
github achillesrasquinha / pipupgrade / tests / pipupgrade / util / test_string.py View on Github external
def test_strip():
    string = "foobar"
    assert strip(string) == string

    string = "\n   foobar\nfoobar   \n   "
    assert strip(string) == "foobar\nfoobar"

    string = "\n\n\n"
    assert strip(string) == ""
github achillesrasquinha / pipupgrade / tests / pipupgrade / util / test_string.py View on Github external
def test_strip():
    string = "foobar"
    assert strip(string) == string

    string = "\n   foobar\nfoobar   \n   "
    assert strip(string) == "foobar\nfoobar"

    string = "\n\n\n"
    assert strip(string) == ""
github achillesrasquinha / pipupgrade / tests / pipupgrade / test__pip.py View on Github external
else:
                    assert not rout
            else:
                assert rout == output

        _assert_outerr(rout, output)
        _assert_outerr(rerr, err)

    directory = tmpdir.mkdir("tmp")
    tempfile  = directory.join("tmp.log")
    path      = str(tempfile)

    _pip.call("install", "pipupgrade")
    assert_pip_call(_pip.call("install", "pipupgrade", quiet = True))
    
    _pip.call("install", "pipupgrade", log = path)
    assert tempfile.read()
github achillesrasquinha / pipupgrade / tests / pipupgrade / test__pip.py View on Github external
if isinstance(output, bool):
                if output:
                    assert rout
                else:
                    assert not rout
            else:
                assert rout == output

        _assert_outerr(rout, output)
        _assert_outerr(rerr, err)

    directory = tmpdir.mkdir("tmp")
    tempfile  = directory.join("tmp.log")
    path      = str(tempfile)

    _pip.call("install", "pipupgrade")
    assert_pip_call(_pip.call("install", "pipupgrade", quiet = True))
    
    _pip.call("install", "pipupgrade", log = path)
    assert tempfile.read()
github achillesrasquinha / pipupgrade / tests / pipupgrade / cli / test_cli_util.py View on Github external
def test_echo(capfd):
    query  = "foobar"
    cli.echo(query, nl = False)
    assert_stdout(capfd, query)
    
    cli.echo(query, nl = True)
    assert_stdout(capfd, "{}\n".format(query))
github achillesrasquinha / pipupgrade / tests / pipupgrade / cli / test_cli__init__.py View on Github external
def foobar(*args, **kwargs):
            args    = get_args()
            params  = merge_dict(args, override)
            
            for k, v in iteritems(values):
                assert params[k] == v

            if initial:
                for k in iterkeys(initial):
                    assert initial[k] == args[k]
github achillesrasquinha / pipupgrade / tests / pipupgrade / test__compat.py View on Github external
def test_iteritems():
    dict_ = dict(foo = "bar")
    
    assert isinstance(iteritems(dict_), Iterable)

    for k, v in iteritems(dict_):
        assert dict_[k] == v