Skip to content

Commit

Permalink
Fix download is True by default
Browse files Browse the repository at this point in the history
Signed-off-by: Bernat Gabor <bgabor8@bloomberg.net>
  • Loading branch information
gaborbernat committed May 4, 2020
1 parent 73793c7 commit 0bb7269
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 7 deletions.
14 changes: 7 additions & 7 deletions src/virtualenv/seed/embed/base_embed.py
Expand Up @@ -45,13 +45,6 @@ def package_version(self):
@classmethod
def add_parser_arguments(cls, parser, interpreter, app_data):
group = parser.add_mutually_exclusive_group()
group.add_argument(
"--download",
dest="download",
action="store_true",
help="pass to enable download of the latest {} from PyPI".format("/".join(cls.packages)),
default=False,
)
group.add_argument(
"--no-download",
"--never-download",
Expand All @@ -60,6 +53,13 @@ def add_parser_arguments(cls, parser, interpreter, app_data):
help="pass to disable download of the latest {} from PyPI".format("/".join(cls.packages)),
default=True,
)
group.add_argument(
"--download",
dest="download",
action="store_true",
help="pass to enable download of the latest {} from PyPI".format("/".join(cls.packages)),
default=False,
)
parser.add_argument(
"--extra-search-dir",
metavar="d",
Expand Down
11 changes: 11 additions & 0 deletions tests/unit/seed/test_base_embed.py
@@ -0,0 +1,11 @@
import pytest

from virtualenv.run import session_via_cli


@pytest.mark.parametrize(
"args, download", [([], False), (["--no-download"], False), (["--never-download"], False), (["--download"], True)]
)
def test_download_cli_flag(args, download, tmp_path):
session = session_via_cli(args + [str(tmp_path)])
assert session.seeder.download is download

0 comments on commit 0bb7269

Please sign in to comment.