From f99de85ef78b959e02a93ac4f4f58741b71c10b7 Mon Sep 17 00:00:00 2001 From: Dan Ryan Date: Tue, 20 Nov 2018 11:00:53 -0500 Subject: [PATCH] Fix pipfile creation with unnamed project - Fixes #3260 Signed-off-by: Dan Ryan --- news/3260.bugfix.rst | 1 + pipenv/project.py | 1 + tests/integration/test_install_basic.py | 8 ++++++++ 3 files changed, 10 insertions(+) create mode 100644 news/3260.bugfix.rst diff --git a/news/3260.bugfix.rst b/news/3260.bugfix.rst new file mode 100644 index 00000000..4a835e6a --- /dev/null +++ b/news/3260.bugfix.rst @@ -0,0 +1 @@ +Fixed an issue which sometimes prevented successful creation of project pipfiles. diff --git a/pipenv/project.py b/pipenv/project.py index b2da4fd2..69f3ad5d 100644 --- a/pipenv/project.py +++ b/pipenv/project.py @@ -693,6 +693,7 @@ class Project(object): ConfigOptionParser, make_option_group, index_group ) + name = self.name if self.name is not None else "Pipfile" config_parser = ConfigOptionParser(name=self.name) config_parser.add_option_group(make_option_group(index_group, config_parser)) install = config_parser.option_groups[0] diff --git a/tests/integration/test_install_basic.py b/tests/integration/test_install_basic.py index c49a9368..b1bc6e69 100644 --- a/tests/integration/test_install_basic.py +++ b/tests/integration/test_install_basic.py @@ -418,3 +418,11 @@ requests ) c = p.pipenv("install --system") assert c.return_code == 0 + + +@pytest.mark.install +def test_install_creates_pipfile(PipenvInstance): + with PipenvInstance(chdir=True) as p: + c = p.pipenv("install") + assert c.return_code == 0 + assert os.path.isfile(p.pipfile_path)