Commit 8c3d49f5 by Sébastien Eustace

Do not add pytest automatically in init

parent f93d4861
...@@ -14,6 +14,7 @@ ...@@ -14,6 +14,7 @@
- Improved solver error messages. - Improved solver error messages.
- `poetry` now always reads/writes the `pyproject.toml` file with the `utf-8` encoding. - `poetry` now always reads/writes the `pyproject.toml` file with the `utf-8` encoding.
- `config --list` now lists all available settings. - `config --list` now lists all available settings.
- `init` no longer adds `pytest` to development dependencies.
### Fixed ### Fixed
......
...@@ -106,7 +106,7 @@ The <info>init</info> command creates a basic <comment>pyproject.toml</> file in ...@@ -106,7 +106,7 @@ The <info>init</info> command creates a basic <comment>pyproject.toml</> file in
self.line("") self.line("")
requirements = [] requirements = {}
question = "Would you like to define your dependencies" " (require) interactively?" question = "Would you like to define your dependencies" " (require) interactively?"
if self.confirm(question, True): if self.confirm(question, True):
...@@ -114,7 +114,7 @@ The <info>init</info> command creates a basic <comment>pyproject.toml</> file in ...@@ -114,7 +114,7 @@ The <info>init</info> command creates a basic <comment>pyproject.toml</> file in
self._determine_requirements(self.option("dependency")) self._determine_requirements(self.option("dependency"))
) )
dev_requirements = [] dev_requirements = {}
question = "Would you like to define your dev dependencies" " (require-dev) interactively" question = "Would you like to define your dev dependencies" " (require-dev) interactively"
if self.confirm(question, True): if self.confirm(question, True):
......
...@@ -58,7 +58,10 @@ class Layout(object): ...@@ -58,7 +58,10 @@ class Layout(object):
self._license = license self._license = license
self._python = python self._python = python
self._dependencies = dependencies or {} self._dependencies = dependencies or {}
self._dev_dependencies = dev_dependencies or {"pytest": "^3.5"} if dev_dependencies is None:
dev_dependencies = {"pytest": "^3.5"}
self._dev_dependencies = dev_dependencies
if not author: if not author:
author = "Your Name <you@example.com>" author = "Your Name <you@example.com>"
......
...@@ -55,7 +55,6 @@ license = "MIT" ...@@ -55,7 +55,6 @@ license = "MIT"
python = "~2.7 || ^3.6" python = "~2.7 || ^3.6"
[tool.poetry.dev-dependencies] [tool.poetry.dev-dependencies]
pytest = "^3.5"
""" """
assert expected in output assert expected in output
...@@ -63,6 +62,7 @@ pytest = "^3.5" ...@@ -63,6 +62,7 @@ pytest = "^3.5"
def test_interactive_with_dependencies(app, repo, mocker, poetry): def test_interactive_with_dependencies(app, repo, mocker, poetry):
repo.add_package(get_package("pendulum", "2.0.0")) repo.add_package(get_package("pendulum", "2.0.0"))
repo.add_package(get_package("pytest", "3.6.0"))
command = app.find("init") command = app.find("init")
command._pool = poetry.pool command._pool = poetry.pool
...@@ -85,7 +85,11 @@ def test_interactive_with_dependencies(app, repo, mocker, poetry): ...@@ -85,7 +85,11 @@ def test_interactive_with_dependencies(app, repo, mocker, poetry):
"0", # First option "0", # First option
"", # Do not set constraint "", # Do not set constraint
"", # Stop searching for packages "", # Stop searching for packages
"n", # Interactive dev packages "", # Interactive dev packages
"pytest", # Search for package
"0",
"",
"",
"\n", # Generate "\n", # Generate
] ]
) )
...@@ -105,7 +109,7 @@ python = "~2.7 || ^3.6" ...@@ -105,7 +109,7 @@ python = "~2.7 || ^3.6"
pendulum = "^2.0" pendulum = "^2.0"
[tool.poetry.dev-dependencies] [tool.poetry.dev-dependencies]
pytest = "^3.5" pytest = "^3.6"
""" """
assert expected in output assert expected in output
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment