Ejemplo n.º 1
0
    def test_dry_run_exit(self):
        with env_var('CONDA_DRY_RUN', 'true', reset_context):
            from conda.cli.common import confirm_yn
            with pytest.raises(DryRunExit):
                confirm_yn()

            from conda.cli.common import confirm
            with pytest.raises(DryRunExit):
                confirm()
Ejemplo n.º 2
0
def test_dry_run_exit():
    with env_var('CONDA_DRY_RUN',
                 'true',
                 stack_callback=conda_tests_ctxt_mgmt_def_pol):
        with pytest.raises(DryRunExit):
            confirm_yn()

        with pytest.raises(DryRunExit):
            confirm()
Ejemplo n.º 3
0
    def test_dry_run_exit(self):
        with env_var('CONDA_DRY_RUN', 'true', reset_context):
            from conda.cli.common import confirm_yn
            with pytest.raises(DryRunExit):
                confirm_yn()

            from conda.cli.common import confirm
            with pytest.raises(DryRunExit):
                confirm()
Ejemplo n.º 4
0
    def test_dry_run_exit(self):
        with env_var('CONDA_DRY_RUN', 'true', conda_tests_ctxt_mgmt_def_pol):
            from conda.cli.common import confirm_yn
            with pytest.raises(DryRunExit):
                confirm_yn()

            from conda.cli.common import confirm
            with pytest.raises(DryRunExit):
                confirm()
Ejemplo n.º 5
0
    def test_dry_run_exit(self):
        with env_var('CONDA_DRY_RUN', 'true', conda_tests_ctxt_mgmt_def_pol):
            from conda.cli.common import confirm_yn
            with pytest.raises(DryRunExit):
                confirm_yn()

            from conda.cli.common import confirm
            with pytest.raises(DryRunExit):
                confirm()
Ejemplo n.º 6
0
    def test_dry_run_exit(self):
        args = AttrDict({
            'dry_run': True,
        })

        from conda.cli.common import confirm_yn
        with pytest.raises(DryRunExit):
            confirm_yn(args)

        from conda.cli.common import confirm
        with pytest.raises(DryRunExit):
            confirm(args)
Ejemplo n.º 7
0
def main(args, windowsonly=True):
    # Returns True for force, otherwise None
    if sys.platform == "win32" or not windowsonly:
        if args.yes:
            check_processes()
        else:
            while not check_processes():
                choice = confirm(args, message="Continue (yes/no/force)", choices=("yes", "no", "force"), default="no")
                if choice == "no":
                    sys.exit(1)
                if choice == "force":
                    return True
Ejemplo n.º 8
0
def main(args, windowsonly=True):
    # Returns True for force, otherwise None
    if sys.platform == 'win32' or not windowsonly:
        if args.yes:
            check_processes()
        else:
            while not check_processes():
                choice = confirm(args, message="Continue (yes/no/force)",
                    choices=('yes', 'no', 'force'), default='no')
                if choice == 'no':
                    sys.exit(1)
                if choice == 'force':
                    return True
Ejemplo n.º 9
0
def main(args, windowsonly=True):
    # Returns True for force, otherwise None
    if sys.platform == 'win32' or not windowsonly:
        if args.yes:
            check_processes()
        else:
            while not check_processes():
                choice = confirm(args, message="Continue (yes/no/force)",
                    choices=('yes', 'no', 'force'), default='no')
                if choice == 'no':
                    sys.exit(1)
                if choice == 'force':
                    return True