Search code examples
pythonpytestpython-poetry

Poetry does not install pytest neither generates basic test


I am following this tutorial on Poetry

I do as written

poetry new rp-poetry

However when I inspect the folder structure, I notice that the file test_rp_poetry.py is not created.

Also the __init__.py is empty and does not contain the version

and looking at the pyproject.toml file I notice that there is no

[tool.poetry.dev-dependencies]

pytest = "^5.2"

Has Poetry changed lately? Does the latest version require that pytest is installed manually??


Solution

  • Since Poetry 1.2 poetry new does not add any dependencies by default anymore. So if you want to use pytest you have to add it by your own.