feat: add --use-tool-poetry flag to poetry init command #10455
Task Summary
Instruction pytest failed in 01:53
Details
✅ 00:03 clone
✅ 01:18 bootstrap_poetry
✅ 00:42 setup_environment
❌ 01:53 pytest
+ where fetch_output = <cleo.io.buffered_io.BufferedIO object at 0x31c0b70a0350>.fetch_output
+ where <cleo.io.buffered_io.BufferedIO object at 0x31c0b70a0350> = <cleo.testers.command_tester.CommandTester object at 0x31c0b70a1ed0>.io
FAILED tests/console/commands/test_init.py::test_package_include[my-package-my_package] - assert '[project]\nname = "my-package"\nversion = "0.1.0"\ndescription = ""\nauthors = [\n {name = "poetry"}\n]\nreadme = "README.md"\nrequires-python = ">=3.10"\ndependencies = [\n]\n' in '\nThis command will guide you through creating your pyproject.toml config.\n\n\nGenerated file\n\n[project]\nname = "my-package"\nversion = "0.1.0"\ndescription = ""\nauthors = [\n {name = "poetry"}\n]\nreadme = "README.md"\nrequires-python = ">=3.10"\ndependencies = []\n\n\n[build-system]\nrequires = ["poetry-core>=2.0.0,<3.0.0"]\nbuild-backend = "poetry.core.masonry.api"\n\n\n'
+ where '\nThis command will guide you through creating your pyproject.toml config.\n\n\nGenerated file\n\n[project]\nname = "my-package"\nversion = "0.1.0"\ndescription = ""\nauthors = [\n {name = "poetry"}\n]\nreadme = "README.md"\nrequires-python = ">=3.10"\ndependencies = []\n\n\n[build-system]\nrequires = ["poetry-core>=2.0.0,<3.0.0"]\nbuild-backend = "poetry.core.masonry.api"\n\n\n' = fetch_output()
+ where fetch_output = <cleo.io.buffered_io.BufferedIO object at 0x157f68396fd0>.fetch_output
+ where <cleo.io.buffered_io.BufferedIO object at 0x157f68396fd0> = <cleo.testers.command_tester.CommandTester object at 0x157f696bcc90>.io
FAILED tests/console/commands/test_init.py::test_interactive_with_git_dependencies_and_other_name - assert '[project]\nname = "my-package"\nversion = "1.2.3"\ndescription = "This is a description"\nauthors = [\n {name = "Your Name",email = "[email protected]"}\n]\nlicense = {text = "MIT"}\nreadme = "README.md"\nrequires-python = ">=3.6"\ndependencies = [\n "demo @ git+https://github.com/demo/pyproject-demo.git"\n]\n\n[tool.poetry]\n\n[tool.poetry.group.dev.dependencies]\npytest = "^3.6.0"\n' in '\nThis command will guide you through creating your pyproject.toml config.\n\n\n You can specify a package in the following forms:\n - A single name (requests): this will search for matches on PyPI\n - A name and a constraint (requests@^2.23.0)\n - A git url (git+https://github.com/python-poetry/poetry.git)\n - A git url with a revision (git+https://github.com/python-poetry/poetry.git#develop)\n - A file path (../my-package/my-package.whl)\n - A directory (../my-package/)\n - A url (https://example.com/packages/my-package-0.1.0.tar.gz)\n \nAdding git+https://github.com/demo/pyproject-demo.git\n\nFound 1 packages matching pytest\nUsing version ^3.6.0 for pytest\n\nGenerated file\n\n[project]\nname = "my-package"\nversion = "1.2.3"\ndescription = "This is a description"\nauthors = [\n {name = "Your Name",email = "[email protected]"}\n]\nlicense = {text = "MIT"}\nreadme = "README.md"\nrequires-python = ">=3.6"\ndependencies = ["demo @ git+https://github.com/demo/pyproject-demo.git"]\n\n[tool.poetry]\n\n[tool.poetry.group.dev.dependencies]\npytest = "^3.6.0"\n\n[build-system]\nrequires = ["poetry-core>=2.0.0,<3.0.0"]\nbuild-backend = "poetry.core.masonry.api"\n\n\n'
+ where '\nThis command will guide you through creating your pyproject.toml config.\n\n\n You can specify a package in the following forms:\n - A single name (requests): this will search for matches on PyPI\n - A name and a constraint (requests@^2.23.0)\n - A git url (git+https://github.com/python-poetry/poetry.git)\n - A git url with a revision (git+https://github.com/python-poetry/poetry.git#develop)\n - A file path (../my-package/my-package.whl)\n - A directory (../my-package/)\n - A url (https://example.com/packages/my-package-0.1.0.tar.gz)\n \nAdding git+https://github.com/demo/pyproject-demo.git\n\nFound 1 packages matching pytest\nUsing version ^3.6.0 for pytest\n\nGenerated file\n\n[project]\nname = "my-package"\nversion = "1.2.3"\ndescription = "This is a description"\nauthors = [\n {name = "Your Name",email = "[email protected]"}\n]\nlicense = {text = "MIT"}\nreadme = "README.md"\nrequires-python = ">=3.6"\ndependencies = ["demo @ git+https://github.com/demo/pyproject-demo.git"]\n\n[tool.poetry]\n\n[tool.poetry.group.dev.dependencies]\npytest = "^3.6.0"\n\n[build-system]\nrequires = ["poetry-core>=2.0.0,<3.0.0"]\nbuild-backend = "poetry.core.masonry.api"\n\n\n' = fetch_output()
+ where fetch_output = <cleo.io.buffered_io.BufferedIO object at 0x157f66633c10>.fetch_output
+ where <cleo.io.buffered_io.BufferedIO object at 0x157f66633c10> = <cleo.testers.command_tester.CommandTester object at 0x157f666312d0>.io
FAILED tests/console/commands/test_init.py::test_interactive_with_directory_dependency - assert '[project]\nname = "my-package"\nversion = "1.2.3"\ndescription = "This is a description"\nauthors = [\n {name = "Your Name",email = "[email protected]"}\n]\nlicense = {text = "MIT"}\nreadme = "README.md"\nrequires-python = ">=3.6"\ndependencies = [\n "demo @ file:///tmp/pytest-of-root/pytest-0/popen-gw0/test_interactive_with_director1/demo"\n]\n\n[tool.poetry]\n\n[tool.poetry.group.dev.dependencies]\npytest = "^3.6.0"\n' in '\nThis command will guide you through creating your pyproject.toml config.\n\n\n You can specify a package in the following forms:\n - A single name (requests): this will search for matches on PyPI\n - A name and a constraint (requests@^2.23.0)\n - A git url (git+https://github.com/python-poetry/poetry.git)\n - A git url with a revision (git+https://github.com/python-poetry/poetry.git#develop)\n - A file path (../my-package/my-package.whl)\n - A directory (../my-package/)\n - A url (https://example.com/packages/my-package-0.1.0.tar.gz)\n \nAdding ./demo\n\nFound 1 packages matching pytest\nUsing version ^3.6.0 for pytest\n\nGenerated file\n\n[project]\nname = "my-package"\nversion = "1.2.3"\ndescription = "This is a description"\nauthors = [\n {name = "Your Name",email = "[email protected]"}\n]\nlicense = {text = "MIT"}\nreadme = "README.md"\nrequires-python = ">=3.6"\ndependencies = ["demo @ file:///tmp/pytest-of-root/pytest-0/popen-gw0/test_interactive_with_director1/demo"]\n\n[tool.poetry]\n\n[tool.poetry.group.dev.dependencies]\npytest = "^3.6.0"\n\n[build-system]\nrequires = ["poetry-core>=2.0.0,<3.0.0"]\nbuild-backend = "poetry.core.masonry.api"\n\n\n'
+ where '\nThis command will guide you through creating your pyproject.toml config.\n\n\n You can specify a package in the following forms:\n - A single name (requests): this will search for matches on PyPI\n - A name and a constraint (requests@^2.23.0)\n - A git url (git+https://github.com/python-poetry/poetry.git)\n - A git url with a revision (git+https://github.com/python-poetry/poetry.git#develop)\n - A file path (../my-package/my-package.whl)\n - A directory (../my-package/)\n - A url (https://example.com/packages/my-package-0.1.0.tar.gz)\n \nAdding ./demo\n\nFound 1 packages matching pytest\nUsing version ^3.6.0 for pytest\n\nGenerated file\n\n[project]\nname = "my-package"\nversion = "1.2.3"\ndescription = "This is a description"\nauthors = [\n {name = "Your Name",email = "[email protected]"}\n]\nlicense = {text = "MIT"}\nreadme = "README.md"\nrequires-python = ">=3.6"\ndependencies = ["demo @ file:///tmp/pytest-of-root/pytest-0/popen-gw0/test_interactive_with_director1/demo"]\n\n[tool.poetry]\n\n[tool.poetry.group.dev.dependencies]\npytest = "^3.6.0"\n\n[build-system]\nrequires = ["poetry-core>=2.0.0,<3.0.0"]\nbuild-backend = "poetry.core.masonry.api"\n\n\n' = fetch_output()
+ where fetch_output = <cleo.io.buffered_io.BufferedIO object at 0x31c0b70b2450>.fetch_output
+ where <cleo.io.buffered_io.BufferedIO object at 0x31c0b70b2450> = <cleo.testers.command_tester.CommandTester object at 0x31c0b70b3950>.io
FAILED tests/console/commands/test_init.py::test_package_include[my.awesome.package-my] - assert '[project]\nname = "my-awesome-package"\nversion = "0.1.0"\ndescription = ""\nauthors = [\n {name = "poetry"}\n]\nreadme = "README.md"\nrequires-python = ">=3.10"\ndependencies = [\n]\n\n[tool.poetry]\npackages = [{include = "my"}]\n' in '\nThis command will guide you through creating your pyproject.toml config.\n\n\nGenerated file\n\n[project]\nname = "my-awesome-package"\nversion = "0.1.0"\ndescription = ""\nauthors = [\n {name = "poetry"}\n]\nreadme = "README.md"\nrequires-python = ">=3.10"\ndependencies = []\n\n[tool.poetry]\npackages = [{include = "my"}]\n\n\n[build-system]\nrequires = ["poetry-core>=2.0.0,<3.0.0"]\nbuild-backend = "poetry.core.masonry.api"\n\n\n'
+ where '\nThis command will guide you through creating your pyproject.toml config.\n\n\nGenerated file\n\n[project]\nname = "my-awesome-package"\nversion = "0.1.0"\ndescription = ""\nauthors = [\n {name = "poetry"}\n]\nreadme = "README.md"\nrequires-python = ">=3.10"\ndependencies = []\n\n[tool.poetry]\npackages = [{include = "my"}]\n\n\n[build-system]\nrequires = ["poetry-core>=2.0.0,<3.0.0"]\nbuild-backend = "poetry.core.masonry.api"\n\n\n' = fetch_output()
+ where fetch_output = <cleo.io.buffered_io.BufferedIO object at 0x31c0b801ec90>.fetch_output
+ where <cleo.io.buffered_io.BufferedIO object at 0x31c0b801ec90> = <cleo.testers.command_tester.CommandTester object at 0x31c0b801e250>.io
FAILED tests/console/commands/test_init.py::test_interactive_with_dependencies - assert '[project]\nname = "my-package"\nversion = "1.2.3"\ndescription = "This is a description"\nauthors = [\n {name = "Your Name",email = "[email protected]"}\n]\nlicense = {text = "MIT"}\nreadme = "README.md"\nrequires-python = ">=3.6"\ndependencies = [\n "pendulum (>=2.0.0,<3.0.0)",\n "flask (>=2.0.0,<3.0.0)"\n]\n\n[tool.poetry]\n\n[tool.poetry.group.dev.dependencies]\npytest = "^3.6.0"\n\n[build-system]\nrequires = ["poetry-core>=2.0.0,<3.0.0"]\nbuild-backend = "poetry.core.masonry.api"\n' in '\nThis command will guide you through creating your pyproject.toml config.\n\n\n You can specify a package in the following forms:\n - A single name (requests): this will search for matches on PyPI\n - A name and a constraint (requests@^2.23.0)\n - A git url (git+https://github.com/python-poetry/poetry.git)\n - A git url with a revision (git+https://github.com/python-poetry/poetry.git#develop)\n - A file path (../my-package/my-package.whl)\n - A directory (../my-package/)\n - A url (https://example.com/packages/my-package-0.1.0.tar.gz)\n \nFound 2 packages matching pendulu\nUsing version ^2.0.0 for pendulum\nFound 1 packages matching Flask\nUsing version ^2.0.0 for flask\n\nFound 1 packages matching pytest\nUsing version ^3.6.0 for pytest\n\nGenerated file\n\n[project]\nname = "my-package"\nversion = "1.2.3"\ndescription = "This is a description"\nauthors = [\n {name = "Your Name",email = "[email protected]"}\n]\nlicense = {text = "MIT"}\nreadme = "README.md"\nrequires-python = ">=3.6"\ndependencies = ["pendulum (>=2.0.0,<3.0.0)", "flask (>=2.0.0,<3.0.0)"]\n\n[tool.poetry]\n\n[tool.poetry.group.dev.dependencies]\npytest = "^3.6.0"\n\n[build-system]\nrequires = ["poetry-core>=2.0.0,<3.0.0"]\nbuild-backend = "poetry.core.masonry.api"\n\n\n'
+ where '\nThis command will guide you through creating your pyproject.toml config.\n\n\n You can specify a package in the following forms:\n - A single name (requests): this will search for matches on PyPI\n - A name and a constraint (requests@^2.23.0)\n - A git url (git+https://github.com/python-poetry/poetry.git)\n - A git url with a revision (git+https://github.com/python-poetry/poetry.git#develop)\n - A file path (../my-package/my-package.whl)\n - A directory (../my-package/)\n - A url (https://example.com/packages/my-package-0.1.0.tar.gz)\n \nFound 2 packages matching pendulu\nUsing version ^2.0.0 for pendulum\nFound 1 packages matching Flask\nUsing version ^2.0.0 for flask\n\nFound 1 packages matching pytest\nUsing version ^3.6.0 for pytest\n\nGenerated file\n\n[project]\nname = "my-package"\nversion = "1.2.3"\ndescription = "This is a description"\nauthors = [\n {name = "Your Name",email = "[email protected]"}\n]\nlicense = {text = "MIT"}\nreadme = "README.md"\nrequires-python = ">=3.6"\ndependencies = ["pendulum (>=2.0.0,<3.0.0)", "flask (>=2.0.0,<3.0.0)"]\n\n[tool.poetry]\n\n[tool.poetry.group.dev.dependencies]\npytest = "^3.6.0"\n\n[build-system]\nrequires = ["poetry-core>=2.0.0,<3.0.0"]\nbuild-backend = "poetry.core.masonry.api"\n\n\n' = fetch_output()
+ where fetch_output = <cleo.io.buffered_io.BufferedIO object at 0x157f668b1410>.fetch_output
+ where <cleo.io.buffered_io.BufferedIO object at 0x157f668b1410> = <cleo.testers.command_tester.CommandTester object at 0x157f668b3450>.io
FAILED tests/console/commands/test_init.py::test_interactive_with_file_dependency - assert '[project]\nname = "my-package"\nversion = "1.2.3"\ndescription = "This is a description"\nauthors = [\n {name = "Your Name",email = "[email protected]"}\n]\nlicense = {text = "MIT"}\nreadme = "README.md"\nrequires-python = ">=3.6"\ndependencies = [\n "demo @ file:///tmp/pytest-of-root/pytest-0/popen-gw1/test_interactive_with_file_dep0/demo-0.1.0-py2.py3-none-any.whl"\n]\n\n[tool.poetry]\n\n[tool.poetry.group.dev.dependencies]\npytest = "^3.6.0"\n' in '\nThis command will guide you through creating your pyproject.toml config.\n\n\n You can specify a package in the following forms:\n - A single name (requests): this will search for matches on PyPI\n - A name and a constraint (requests@^2.23.0)\n - A git url (git+https://github.com/python-poetry/poetry.git)\n - A git url with a revision (git+https://github.com/python-poetry/poetry.git#develop)\n - A file path (../my-package/my-package.whl)\n - A directory (../my-package/)\n - A url (https://example.com/packages/my-package-0.1.0.tar.gz)\n \nAdding ./demo-0.1.0-py2.py3-none-any.whl\n\nFound 1 packages matching pytest\nUsing version ^3.6.0 for pytest\n\nGenerated file\n\n[project]\nname = "my-package"\nversion = "1.2.3"\ndescription = "This is a description"\nauthors = [\n {name = "Your Name",email = "[email protected]"}\n]\nlicense = {text = "MIT"}\nreadme = "README.md"\nrequires-python = ">=3.6"\ndependencies = ["demo @ file:///tmp/pytest-of-root/pytest-0/popen-gw1/test_interactive_with_file_dep0/demo-0.1.0-py2.py3-none-any.whl"]\n\n[tool.poetry]\n\n[tool.poetry.group.dev.dependencies]\npytest = "^3.6.0"\n\n[build-system]\nrequires = ["poetry-core>=2.0.0,<3.0.0"]\nbuild-backend = "poetry.core.masonry.api"\n\n\n'
+ where '\nThis command will guide you through creating your pyproject.toml config.\n\n\n You can specify a package in the following forms:\n - A single name (requests): this will search for matches on PyPI\n - A name and a constraint (requests@^2.23.0)\n - A git url (git+https://github.com/python-poetry/poetry.git)\n - A git url with a revision (git+https://github.com/python-poetry/poetry.git#develop)\n - A file path (../my-package/my-package.whl)\n - A directory (../my-package/)\n - A url (https://example.com/packages/my-package-0.1.0.tar.gz)\n \nAdding ./demo-0.1.0-py2.py3-none-any.whl\n\nFound 1 packages matching pytest\nUsing version ^3.6.0 for pytest\n\nGenerated file\n\n[project]\nname = "my-package"\nversion = "1.2.3"\ndescription = "This is a description"\nauthors = [\n {name = "Your Name",email = "[email protected]"}\n]\nlicense = {text = "MIT"}\nreadme = "README.md"\nrequires-python = ">=3.6"\ndependencies = ["demo @ file:///tmp/pytest-of-root/pytest-0/popen-gw1/test_interactive_with_file_dep0/demo-0.1.0-py2.py3-none-any.whl"]\n\n[tool.poetry]\n\n[tool.poetry.group.dev.dependencies]\npytest = "^3.6.0"\n\n[build-system]\nrequires = ["poetry-core>=2.0.0,<3.0.0"]\nbuild-backend = "poetry.core.masonry.api"\n\n\n' = fetch_output()
+ where fetch_output = <cleo.io.buffered_io.BufferedIO object at 0x157f6915ead0>.fetch_output
+ where <cleo.io.buffered_io.BufferedIO object at 0x157f6915ead0> = <cleo.testers.command_tester.CommandTester object at 0x157f6915edd0>.io
FAILED tests/console/commands/test_init.py::test_init_non_interactive_existing_pyproject_add_dependency - assert '\n[tool.black]\nline-length = 88\n\n[project]\nname = "my-package"\nversion = "0.1.0"\ndescription = ""\nauthors = [\n {name = "Your Name",email = "[email protected]"}\n]\nreadme = "README.md"\nrequires-python = ">=3.6"\ndependencies = [\n "foo (>=1.19.2,<2.0.0)"\n]\n' in '\n[tool.black]\nline-length = 88\n\n[project]\nname = "my-package"\nversion = "0.1.0"\ndescription = ""\nauthors = [\n {name = "Your Name",email = "[email protected]"}\n]\nreadme = "README.md"\nrequires-python = ">=3.6"\ndependencies = ["foo (>=1.19.2,<2.0.0)"]\n\n\n[build-system]\nrequires = ["poetry-core>=2.0.0,<3.0.0"]\nbuild-backend = "poetry.core.masonry.api"\n'
+ where '\n[tool.black]\nline-length = 88\n\n[project]\nname = "my-package"\nversion = "0.1.0"\ndescription = ""\nauthors = [\n {name = "Your Name",email = "[email protected]"}\n]\nreadme = "README.md"\nrequires-python = ">=3.6"\ndependencies = ["foo (>=1.19.2,<2.0.0)"]\n\n\n[build-system]\nrequires = ["poetry-core>=2.0.0,<3.0.0"]\nbuild-backend = "poetry.core.masonry.api"\n' = read_text(encoding='utf-8')
+ where read_text = PosixPath('/tmp/pytest-of-root/pytest-0/popen-gw0/test_init_non_interactive_exis0/pyproject.toml').read_text
FAILED tests/console/commands/test_init.py::test_predefined_all_options - assert '[project]\nname = "my-package"\nversion = "1.2.3"\ndescription = "This is a description"\nauthors = [\n {name = "Foo Bar",email = "[email protected]"}\n]\nlicense = {text = "MIT"}\nreadme = "README.md"\nrequires-python = ">=3.8"\ndependencies = [\n "pendulum (>=2.0.0,<3.0.0)"\n]\n\n[tool.poetry]\n\n[tool.poetry.group.dev.dependencies]\npytest = "^3.6.0"\n' in '\nThis command will guide you through creating your pyproject.toml config.\n\n\nUsing version ^2.0.0 for pendulum\nUsing version ^3.6.0 for pytest\nGenerated file\n\n[project]\nname = "my-package"\nversion = "1.2.3"\ndescription = "This is a description"\nauthors = [\n {name = "Foo Bar",email = "[email protected]"}\n]\nlicense = {text = "MIT"}\nreadme = "README.md"\nrequires-python = ">=3.8"\ndependencies = ["pendulum (>=2.0.0,<3.0.0)"]\n\n[tool.poetry]\n\n[tool.poetry.group.dev.dependencies]\npytest = "^3.6.0"\n\n[build-system]\nrequires = ["poetry-core>=2.0.0,<3.0.0"]\nbuild-backend = "poetry.core.masonry.api"\n\n\n'
FAILED tests/console/commands/test_init.py::test_package_include[my.package-my] - assert '[project]\nname = "my-package"\nversion = "0.1.0"\ndescription = ""\nauthors = [\n {name = "poetry"}\n]\nreadme = "README.md"\nrequires-python = ">=3.10"\ndependencies = [\n]\n\n[tool.poetry]\npackages = [{include = "my"}]\n' in '\nThis command will guide you through creating your pyproject.toml config.\n\n\nGenerated file\n\n[project]\nname = "my-package"\nversion = "0.1.0"\ndescription = ""\nauthors = [\n {name = "poetry"}\n]\nreadme = "README.md"\nrequires-python = ">=3.10"\ndependencies = []\n\n[tool.poetry]\npackages = [{include = "my"}]\n\n\n[build-system]\nrequires = ["poetry-core>=2.0.0,<3.0.0"]\nbuild-backend = "poetry.core.masonry.api"\n\n\n'
+ where '\nThis command will guide you through creating your pyproject.toml config.\n\n\nGenerated file\n\n[project]\nname = "my-package"\nversion = "0.1.0"\ndescription = ""\nauthors = [\n {name = "poetry"}\n]\nreadme = "README.md"\nrequires-python = ">=3.10"\ndependencies = []\n\n[tool.poetry]\npackages = [{include = "my"}]\n\n\n[build-system]\nrequires = ["poetry-core>=2.0.0,<3.0.0"]\nbuild-backend = "poetry.core.masonry.api"\n\n\n' = fetch_output()
+ where fetch_output = <cleo.io.buffered_io.BufferedIO object at 0x157f657f1d90>.fetch_output
+ where <cleo.io.buffered_io.BufferedIO object at 0x157f657f1d90> = <cleo.testers.command_tester.CommandTester object at 0x157f657f35d0>.io
FAILED tests/console/commands/test_init.py::test_predefined_and_interactive_dependencies - assert '[project]\nname = "my-package"\nversion = "1.2.3"\ndescription = "This is a description"\nauthors = [\n {name = "Your Name",email = "[email protected]"}\n]\nlicense = {text = "MIT"}\nreadme = "README.md"\nrequires-python = ">=3.6"\ndependencies = [\n "pendulum (>=2.0.0,<3.0.0)",\n "pyramid (>=1.10,<2.0)"\n]\n' in '\nThis command will guide you through creating your pyproject.toml config.\n\n\nUsing version ^2.0.0 for pendulum\n You can specify a package in the following forms:\n - A single name (requests): this will search for matches on PyPI\n - A name and a constraint (requests@^2.23.0)\n - A git url (git+https://github.com/python-poetry/poetry.git)\n - A git url with a revision (git+https://github.com/python-poetry/poetry.git#develop)\n - A file path (../my-package/my-package.whl)\n - A directory (../my-package/)\n - A url (https://example.com/packages/my-package-0.1.0.tar.gz)\n \nFound 1 packages matching pyramid\nUsing version ^1.10 for pyramid\n\nGenerated file\n\n[project]\nname = "my-package"\nversion = "1.2.3"\ndescription = "This is a description"\nauthors = [\n {name = "Your Name",email = "[email protected]"}\n]\nlicense = {text = "MIT"}\nreadme = "README.md"\nrequires-python = ">=3.6"\ndependencies = ["pendulum (>=2.0.0,<3.0.0)", "pyramid (>=1.10,<2.0)"]\n\n\n[build-system]\nrequires = ["poetry-core>=2.0.0,<3.0.0"]\nbuild-backend = "poetry.core.masonry.api"\n\n\n'
+ where '\nThis command will guide you through creating your pyproject.toml config.\n\n\nUsing version ^2.0.0 for pendulum\n You can specify a package in the following forms:\n - A single name (requests): this will search for matches on PyPI\n - A name and a constraint (requests@^2.23.0)\n - A git url (git+https://github.com/python-poetry/poetry.git)\n - A git url with a revision (git+https://github.com/python-poetry/poetry.git#develop)\n - A file path (../my-package/my-package.whl)\n - A directory (../my-package/)\n - A url (https://example.com/packages/my-package-0.1.0.tar.gz)\n \nFound 1 packages matching pyramid\nUsing version ^1.10 for pyramid\n\nGenerated file\n\n[project]\nname = "my-package"\nversion = "1.2.3"\ndescription = "This is a description"\nauthors = [\n {name = "Your Name",email = "[email protected]"}\n]\nlicense = {text = "MIT"}\nreadme = "README.md"\nrequires-python = ">=3.6"\ndependencies = ["pendulum (>=2.0.0,<3.0.0)", "pyramid (>=1.10,<2.0)"]\n\n\n[build-system]\nrequires = ["poetry-core>=2.0.0,<3.0.0"]\nbuild-backend = "poetry.core.masonry.api"\n\n\n' = fetch_output()
+ where fetch_output = <cleo.io.buffered_io.BufferedIO object at 0x157f6969e6d0>.fetch_output
+ where <cleo.io.buffered_io.BufferedIO object at 0x157f6969e6d0> = <cleo.testers.command_tester.CommandTester object at 0x157f6969ed90>.io
FAILED tests/console/commands/test_init.py::test_predefined_and_interactive_dev_dependencies - assert '[project]\nname = "my-package"\nversion = "1.2.3"\ndescription = "This is a description"\nauthors = [\n {name = "Your Name",email = "[email protected]"}\n]\nlicense = {text = "MIT"}\nreadme = "README.md"\nrequires-python = ">=3.6"\ndependencies = [\n]\n\n[tool.poetry]\n\n[tool.poetry.group.dev.dependencies]\npytest = "^3.6.0"\npytest-requests = "^0.2.0"\n' in '\nThis command will guide you through creating your pyproject.toml config.\n\n\nUsing version ^3.6.0 for pytest\n You can specify a package in the following forms:\n - A single name (requests): this will search for matches on PyPI\n - A name and a constraint (requests@^2.23.0)\n - A git url (git+https://github.com/python-poetry/poetry.git)\n - A git url with a revision (git+https://github.com/python-poetry/poetry.git#develop)\n - A file path (../my-package/my-package.whl)\n - A directory (../my-package/)\n - A url (https://example.com/packages/my-package-0.1.0.tar.gz)\n \nFound 1 packages matching pytest-requests\nUsing version ^0.2.0 for pytest-requests\n\nGenerated file\n\n[project]\nname = "my-package"\nversion = "1.2.3"\ndescription = "This is a description"\nauthors = [\n {name = "Your Name",email = "[email protected]"}\n]\nlicense = {text = "MIT"}\nreadme = "README.md"\nrequires-python = ">=3.6"\ndependencies = []\n\n[tool.poetry]\n\n[tool.poetry.group.dev.dependencies]\npytest = "^3.6.0"\npytest-requests = "^0.2.0"\n\n[build-system]\nrequires = ["poetry-core>=2.0.0,<3.0.0"]\nbuild-backend = "poetry.core.masonry.api"\n\n\n'
FAILED tests/console/commands/test_init.py::test_predefined_dependency - assert '[project]\nname = "my-package"\nversion = "1.2.3"\ndescription = "This is a description"\nauthors = [\n {name = "Your Name",email = "[email protected]"}\n]\nlicense = {text = "MIT"}\nreadme = "README.md"\nrequires-python = ">=3.6"\ndependencies = [\n "pendulum (>=2.0.0,<3.0.0)"\n]\n' in '\nThis command will guide you through creating your pyproject.toml config.\n\n\nUsing version ^2.0.0 for pendulum\nGenerated file\n\n[project]\nname = "my-package"\nversion = "1.2.3"\ndescription = "This is a description"\nauthors = [\n {name = "Your Name",email = "[email protected]"}\n]\nlicense = {text = "MIT"}\nreadme = "README.md"\nrequires-python = ">=3.6"\ndependencies = ["pendulum (>=2.0.0,<3.0.0)"]\n\n\n[build-system]\nrequires = ["poetry-core>=2.0.0,<3.0.0"]\nbuild-backend = "poetry.core.masonry.api"\n\n\n'
+ where '\nThis command will guide you through creating your pyproject.toml config.\n\n\nUsing version ^2.0.0 for pendulum\nGenerated file\n\n[project]\nname = "my-package"\nversion = "1.2.3"\ndescription = "This is a description"\nauthors = [\n {name = "Your Name",email = "[email protected]"}\n]\nlicense = {text = "MIT"}\nreadme = "README.md"\nrequires-python = ">=3.6"\ndependencies = ["pendulum (>=2.0.0,<3.0.0)"]\n\n\n[build-system]\nrequires = ["poetry-core>=2.0.0,<3.0.0"]\nbuild-backend = "poetry.core.masonry.api"\n\n\n' = fetch_output()
+ where fetch_output = <cleo.io.buffered_io.BufferedIO object at 0x31c0b8c89c50>.fetch_output
+ where <cleo.io.buffered_io.BufferedIO object at 0x31c0b8c89c50> = <cleo.testers.command_tester.CommandTester object at 0x31c0b8c88750>.io
FAILED tests/console/commands/test_init.py::test_predefined_dev_dependency - assert '[project]\nname = "my-package"\nversion = "1.2.3"\ndescription = "This is a description"\nauthors = [\n {name = "Your Name",email = "[email protected]"}\n]\nlicense = {text = "MIT"}\nreadme = "README.md"\nrequires-python = ">=3.6"\ndependencies = [\n]\n\n[tool.poetry]\n\n[tool.poetry.group.dev.dependencies]\npytest = "^3.6.0"\n' in '\nThis command will guide you through creating your pyproject.toml config.\n\n\nUsing version ^3.6.0 for pytest\nGenerated file\n\n[project]\nname = "my-package"\nversion = "1.2.3"\ndescription = "This is a description"\nauthors = [\n {name = "Your Name",email = "[email protected]"}\n]\nlicense = {text = "MIT"}\nreadme = "README.md"\nrequires-python = ">=3.6"\ndependencies = []\n\n[tool.poetry]\n\n[tool.poetry.group.dev.dependencies]\npytest = "^3.6.0"\n\n[build-system]\nrequires = ["poetry-core>=2.0.0,<3.0.0"]\nbuild-backend = "poetry.core.masonry.api"\n\n\n'
+ where '\nThis command will guide you through creating your pyproject.toml config.\n\n\nUsing version ^3.6.0 for pytest\nGenerated file\n\n[project]\nname = "my-package"\nversion = "1.2.3"\ndescription = "This is a description"\nauthors = [\n {name = "Your Name",email = "[email protected]"}\n]\nlicense = {text = "MIT"}\nreadme = "README.md"\nrequires-python = ">=3.6"\ndependencies = []\n\n[tool.poetry]\n\n[tool.poetry.group.dev.dependencies]\npytest = "^3.6.0"\n\n[build-system]\nrequires = ["poetry-core>=2.0.0,<3.0.0"]\nbuild-backend = "poetry.core.masonry.api"\n\n\n' = fetch_output()
+ where fetch_output = <cleo.io.buffered_io.BufferedIO object at 0x31c0b4acec90>.fetch_output
+ where <cleo.io.buffered_io.BufferedIO object at 0x31c0b4acec90> = <cleo.testers.command_tester.CommandTester object at 0x31c0b4acee10>.io
FAILED tests/console/commands/test_init.py::test_interactive_with_git_dependencies_with_reference - assert '[project]\nname = "my-package"\nversion = "1.2.3"\ndescription = "This is a description"\nauthors = [\n {name = "Your Name",email = "[email protected]"}\n]\nlicense = {text = "MIT"}\nreadme = "README.md"\nrequires-python = ">=3.6"\ndependencies = [\n "demo @ git+https://github.com/demo/demo.git@develop"\n]\n\n[tool.poetry]\n\n[tool.poetry.group.dev.dependencies]\npytest = "^3.6.0"\n' in '\nThis command will guide you through creating your pyproject.toml config.\n\n\n You can specify a package in the following forms:\n - A single name (requests): this will search for matches on PyPI\n - A name and a constraint (requests@^2.23.0)\n - A git url (git+https://github.com/python-poetry/poetry.git)\n - A git url with a revision (git+https://github.com/python-poetry/poetry.git#develop)\n - A file path (../my-package/my-package.whl)\n - A directory (../my-package/)\n - A url (https://example.com/packages/my-package-0.1.0.tar.gz)\n \nAdding git+https://github.com/demo/demo.git@develop\n\nFound 1 packages matching pytest\nUsing version ^3.6.0 for pytest\n\nGenerated file\n\n[project]\nname = "my-package"\nversion = "1.2.3"\ndescription = "This is a description"\nauthors = [\n {name = "Your Name",email = "[email protected]"}\n]\nlicense = {text = "MIT"}\nreadme = "README.md"\nrequires-python = ">=3.6"\ndependencies = ["demo @ git+https://github.com/demo/demo.git@develop"]\n\n[tool.poetry]\n\n[tool.poetry.group.dev.dependencies]\npytest = "^3.6.0"\n\n[build-system]\nrequires = ["poetry-core>=2.0.0,<3.0.0"]\nbuild-backend = "poetry.core.masonry.api"\n\n\n'
+ where '\nThis command will guide you through creating your pyproject.toml config.\n\n\n You can specify a package in the following forms:\n - A single name (requests): this will search for matches on PyPI\n - A name and a constraint (requests@^2.23.0)\n - A git url (git+https://github.com/python-poetry/poetry.git)\n - A git url with a revision (git+https://github.com/python-poetry/poetry.git#develop)\n - A file path (../my-package/my-package.whl)\n - A directory (../my-package/)\n - A url (https://example.com/packages/my-package-0.1.0.tar.gz)\n \nAdding git+https://github.com/demo/demo.git@develop\n\nFound 1 packages matching pytest\nUsing version ^3.6.0 for pytest\n\nGenerated file\n\n[project]\nname = "my-package"\nversion = "1.2.3"\ndescription = "This is a description"\nauthors = [\n {name = "Your Name",email = "[email protected]"}\n]\nlicense = {text = "MIT"}\nreadme = "README.md"\nrequires-python = ">=3.6"\ndependencies = ["demo @ git+https://github.com/demo/demo.git@develop"]\n\n[tool.poetry]\n\n[tool.poetry.group.dev.dependencies]\npytest = "^3.6.0"\n\n[build-system]\nrequires = ["poetry-core>=2.0.0,<3.0.0"]\nbuild-backend = "poetry.core.masonry.api"\n\n\n' = fetch_output()
+ where fetch_output = <cleo.io.buffered_io.BufferedIO object at 0x157f69cd3e90>.fetch_output
+ where <cleo.io.buffered_io.BufferedIO object at 0x157f69cd3e90> = <cleo.testers.command_tester.CommandTester object at 0x157f69cd2f90>.io
FAILED tests/console/commands/test_new.py::test_basic_interactive_new - assert '[project]\nname = "my-package"\nversion = "1.2.3"\ndescription = "This is a description"\nauthors = [\n {name = "Your Name",email = "[email protected]"}\n]\nlicense = {text = "MIT"}\nreadme = "README.md"\nrequires-python = ">=3.6"\ndependencies = [\n]\n\n[tool.poetry]\npackages = [{include = "my_package", from = "src"}]\n' in '\nThis command will guide you through creating your pyproject.toml config.\n\n\nGenerated file\n\n[project]\nname = "my-package"\nversion = "1.2.3"\ndescription = "This is a description"\nauthors = [\n {name = "Your Name",email = "[email protected]"}\n]\nlicense = {text = "MIT"}\nreadme = "README.md"\nrequires-python = ">=3.6"\ndependencies = []\n\n[tool.poetry]\npackages = [{include = "my_package", from = "src"}]\n\n\n[build-system]\nrequires = ["poetry-core>=2.0.0,<3.0.0"]\nbuild-backend = "poetry.core.masonry.api"\n\n\nCreated package my_package in somepackage\n'
+ where '\nThis command will guide you through creating your pyproject.toml config.\n\n\nGenerated file\n\n[project]\nname = "my-package"\nversion = "1.2.3"\ndescription = "This is a description"\nauthors = [\n {name = "Your Name",email = "[email protected]"}\n]\nlicense = {text = "MIT"}\nreadme = "README.md"\nrequires-python = ">=3.6"\ndependencies = []\n\n[tool.poetry]\npackages = [{include = "my_package", from = "src"}]\n\n\n[build-system]\nrequires = ["poetry-core>=2.0.0,<3.0.0"]\nbuild-backend = "poetry.core.masonry.api"\n\n\nCreated package my_package in somepackage\n' = fetch_output()
+ where fetch_output = <cleo.io.buffered_io.BufferedIO object at 0x31c0b7168850>.fetch_output
+ where <cleo.io.buffered_io.BufferedIO object at 0x31c0b7168850> = <cleo.testers.command_tester.CommandTester object at 0x31c0b73fb510>.io
=========== 20 failed, 2647 passed, 10 skipped in 110.84s (0:01:50) ============Annotations
Check failure on line 1099 in tests/console/commands/test_init.py
cirrus-ci / Tests / FreeBSD (Python 3.11) / pytest
tests/console/commands/test_init.py#L1099
tests.console.commands.test_init.test_package_include[my-awesome-package-my_awesome_package]
Raw output
tester = <cleo.testers.command_tester.CommandTester object at 0x31c0b731a510>
package_name = 'my-awesome-package', include = 'my_awesome_package'
@pytest.mark.parametrize(
"package_name, include",
(
("mypackage", None),
("my-package", "my_package"),
("my.package", "my"),
("my-awesome-package", "my_awesome_package"),
("my.awesome.package", "my"),
),
)
def test_package_include(
tester: CommandTester,
package_name: str,
include: str | None,
) -> None:
tester.execute(
inputs="\n".join(
(
package_name,
"", # Version
"", # Description
"poetry", # Author
"", # License
">=3.10", # Python
"n", # Interactive packages
"n", # Interactive dev packages
"\n", # Generate
),
),
)
packages = ""
if include and module_name(package_name) != include:
packages = f'\n[tool.poetry]\npackages = [{{include = "{include}"}}]\n'
expected = (
"[project]\n"
f'name = "{package_name.replace(".", "-")}"\n' # canonicalized
'version = "0.1.0"\n'
'description = ""\n'
"authors = [\n"
' {name = "poetry"}\n'
"]\n"
'readme = "README.md"\n'
'requires-python = ">=3.10"\n'
"dependencies = [\n"
"]\n"
f"{packages}" # This line is optional. Thus, no newline here.
)
> assert expected in tester.io.fetch_output()
E assert '[project]\nname = "my-awesome-package"\nversion = "0.1.0"\ndescription = ""\nauthors = [\n {name = "poetry"}\n]\nreadme = "README.md"\nrequires-python = ">=3.10"\ndependencies = [\n]\n' in '\nThis command will guide you through creating your pyproject.toml config.\n\n\nGenerated file\n\n[project]\nname = "my-awesome-package"\nversion = "0.1.0"\ndescription = ""\nauthors = [\n {name = "poetry"}\n]\nreadme = "README.md"\nrequires-python = ">=3.10"\ndependencies = []\n\n\n[build-system]\nrequires = ["poetry-core>=2.0.0,<3.0.0"]\nbuild-backend = "poetry.core.masonry.api"\n\n\n'
E + where '\nThis command will guide you through creating your pyproject.toml config.\n\n\nGenerated file\n\n[project]\nname = "my-awesome-package"\nversion = "0.1.0"\ndescription = ""\nauthors = [\n {name = "poetry"}\n]\nreadme = "README.md"\nrequires-python = ">=3.10"\ndependencies = []\n\n\n[build-system]\nrequires = ["poetry-core>=2.0.0,<3.0.0"]\nbuild-backend = "poetry.core.masonry.api"\n\n\n' = fetch_output()
E + where fetch_output = <cleo.io.buffered_io.BufferedIO object at 0x31c0b731a950>.fetch_output
E + where <cleo.io.buffered_io.BufferedIO object at 0x31c0b731a950> = <cleo.testers.command_tester.CommandTester object at 0x31c0b731a510>.io
/tmp/cirrus-ci-build/tests/console/commands/test_init.py:1099: AssertionError
Check failure on line 543 in tests/console/commands/test_init.py
cirrus-ci / Tests / FreeBSD (Python 3.11) / pytest
tests/console/commands/test_init.py#L543
tests.console.commands.test_init.test_interactive_with_directory_dependency_and_other_name
Raw output
tester = <cleo.testers.command_tester.CommandTester object at 0x31c0b46e6cd0>
repo = <tests.helpers.TestRepository object at 0x31c0b8034350>
source_dir = PosixPath('/tmp/pytest-of-root/pytest-0/popen-gw0/test_interactive_with_director0')
fixture_dir = <function fixture_dir.<locals>._fixture_dir at 0x31c0b4934900>
def test_interactive_with_directory_dependency_and_other_name(
tester: CommandTester,
repo: TestRepository,
source_dir: Path,
fixture_dir: FixtureDirGetter,
) -> None:
repo.add_package(get_package("pendulum", "2.0.0"))
repo.add_package(get_package("pytest", "3.6.0"))
demo = fixture_dir("git") / "github.com" / "demo" / "pyproject-demo"
shutil.copytree(str(demo), str(source_dir / "pyproject-demo"))
inputs = [
"my-package", # Package name
"1.2.3", # Version
"This is a description", # Description
"n", # Author
"MIT", # License
">=3.6", # Python
"", # Interactive packages
"./pyproject-demo", # Search for package
"", # Stop searching for packages
"", # Interactive dev packages
"pytest", # Search for package
"0",
"",
"",
"\n", # Generate
]
tester.execute(inputs="\n".join(inputs))
demo_uri = (Path.cwd() / "pyproject-demo").as_uri()
expected = f"""\
[project]
name = "my-package"
version = "1.2.3"
description = "This is a description"
authors = [
{{name = "Your Name",email = "[email protected]"}}
]
license = {{text = "MIT"}}
readme = "README.md"
requires-python = ">=3.6"
dependencies = [
"demo @ {demo_uri}"
]
[tool.poetry]
[tool.poetry.group.dev.dependencies]
pytest = "^3.6.0"
"""
> assert expected in tester.io.fetch_output()
E assert '[project]\nname = "my-package"\nversion = "1.2.3"\ndescription = "This is a description"\nauthors = [\n {name = "Your Name",email = "[email protected]"}\n]\nlicense = {text = "MIT"}\nreadme = "README.md"\nrequires-python = ">=3.6"\ndependencies = [\n "demo @ file:///tmp/pytest-of-root/pytest-0/popen-gw0/test_interactive_with_director0/pyproject-demo"\n]\n\n[tool.poetry]\n\n[tool.poetry.group.dev.dependencies]\npytest = "^3.6.0"\n' in '\nThis command will guide you through creating your pyproject.toml config.\n\n\n You can specify a package in the following forms:\n - A single name (requests): this will search for matches on PyPI\n - A name and a constraint (requests@^2.23.0)\n - A git url (git+https://github.com/python-poetry/poetry.git)\n - A git url with a revision (git+https://github.com/python-poetry/poetry.git#develop)\n - A file path (../my-package/my-package.whl)\n - A directory (../my-package/)\n - A url (https://example.com/packages/my-package-0.1.0.tar.gz)\n \nAdding ./pyproject-demo\n\nFound 1 packages matching pytest\nUsing version ^3.6.0 for pytest\n\nGenerated file\n\n[project]\nname = "my-package"\nversion = "1.2.3"\ndescription = "This is a description"\nauthors = [\n {name = "Your Name",email = "[email protected]"}\n]\nlicense = {text = "MIT"}\nreadme = "README.md"\nrequires-python = ">=3.6"\ndependencies = ["demo @ file:///tmp/pytest-of-root/pytest-0/popen-gw0/test_interactive_with_director0/pyproject-demo"]\n\n[tool.poetry]\n\n[tool.poetry.group.dev.dependencies]\npytest = "^3.6.0"\n\n[build-system]\nrequires = ["poetry-core>=2.0.0,<3.0.0"]\nbuild-backend = "poetry.core.masonry.api"\n\n\n'
E + where '\nThis command will guide you through creating your pyproject.toml config.\n\n\n You can specify a package in the following forms:\n - A single name (requests): this will search for matches on PyPI\n - A name and a constraint (requests@^2.23.0)\n - A git url (git+https://github.com/python-poetry/poetry.git)\n - A git url with a revision (git+https://github.com/python-poetry/poetry.git#develop)\n - A file path (../my-package/my-package.whl)\n - A directory (../my-package/)\n - A url (https://example.com/packages/my-package-0.1.0.tar.gz)\n \nAdding ./pyproject-demo\n\nFound 1 packages matching pytest\nUsing version ^3.6.0 for pytest\n\nGenerated file\n\n[project]\nname = "my-package"\nversion = "1.2.3"\ndescription = "This is a description"\nauthors = [\n {name = "Your Name",email = "[email protected]"}\n]\nlicense = {text = "MIT"}\nreadme = "README.md"\nrequires-python = ">=3.6"\ndependencies = ["demo @ file:///tmp/pytest-of-root/pytest-0/popen-gw0/test_interactive_with_director0/pyproject-demo"]\n\n[tool.poetry]\n\n[tool.poetry.group.dev.dependencies]\npytest = "^3.6.0"\n\n[build-system]\nrequires = ["poetry-core>=2.0.0,<3.0.0"]\nbuild-backend = "poetry.core.masonry.api"\n\n\n' = fetch_output()
E + where fetch_output = <cleo.io.buffered_io.BufferedIO object at 0x31c0b46e7f90>.fetch_output
E + where <cleo.io.buffered_io.BufferedIO object at 0x31c0b46e7f90> = <cleo.testers.command_tester.CommandTester object at 0x31c0b46e6cd0>.io
/tmp/cirrus-ci-build/tests/console/commands/test_init.py:543: AssertionError
Check failure on line 648 in tests/console/commands/test_init.py
cirrus-ci / Tests / FreeBSD (Python 3.11) / pytest
tests/console/commands/test_init.py#L648
tests.console.commands.test_init.test_interactive_with_wrong_dependency_inputs
Raw output
tester = <cleo.testers.command_tester.CommandTester object at 0x31c0b4b26a50>
repo = <tests.helpers.TestRepository object at 0x31c0b2bc74d0>
def test_interactive_with_wrong_dependency_inputs(
tester: CommandTester, repo: TestRepository
) -> None:
inputs = [
"my-package", # Package name
"1.2.3", # Version
"This is a description", # Description
"n", # Author
"MIT", # License
">=3.8", # Python
"", # Interactive packages
"foo 1.19.2",
"pendulum 2.0.0 foo", # Package name and constraint (invalid)
"pendulum@^2.0.0", # Package name and constraint (valid)
"", # End package selection
"", # Interactive dev packages
"pytest 3.6.0 foo", # Dev package name and constraint (invalid)
"pytest 3.6.0", # Dev package name and constraint (invalid)
"[email protected]", # Dev package name and constraint (valid)
"", # End package selection
"\n", # Generate
]
tester.execute(inputs="\n".join(inputs))
expected = """\
[project]
name = "my-package"
version = "1.2.3"
description = "This is a description"
authors = [
{name = "Your Name",email = "[email protected]"}
]
license = {text = "MIT"}
readme = "README.md"
requires-python = ">=3.8"
dependencies = [
"foo (==1.19.2)",
"pendulum (>=2.0.0,<3.0.0)"
]
[tool.poetry]
[tool.poetry.group.dev.dependencies]
pytest = "3.6.0"
"""
> assert expected in tester.io.fetch_output()
E assert '[project]\nname = "my-package"\nversion = "1.2.3"\ndescription = "This is a description"\nauthors = [\n {name = "Your Name",email = "[email protected]"}\n]\nlicense = {text = "MIT"}\nreadme = "README.md"\nrequires-python = ">=3.8"\ndependencies = [\n "foo (==1.19.2)",\n "pendulum (>=2.0.0,<3.0.0)"\n]\n\n[tool.poetry]\n\n[tool.poetry.group.dev.dependencies]\npytest = "3.6.0"\n' in '\nThis command will guide you through creating your pyproject.toml config.\n\n\n You can specify a package in the following forms:\n - A single name (requests): this will search for matches on PyPI\n - A name and a constraint (requests@^2.23.0)\n - A git url (git+https://github.com/python-poetry/poetry.git)\n - A git url with a revision (git+https://github.com/python-poetry/poetry.git#develop)\n - A file path (../my-package/my-package.whl)\n - A directory (../my-package/)\n - A url (https://example.com/packages/my-package-0.1.0.tar.gz)\n \nAdding foo 1.19.2\nAdding pendulum@^2.0.0\n\nAdding pytest 3.6.0\nAdding [email protected]\n\nGenerated file\n\n[project]\nname = "my-package"\nversion = "1.2.3"\ndescription = "This is a description"\nauthors = [\n {name = "Your Name",email = "[email protected]"}\n]\nlicense = {text = "MIT"}\nreadme = "README.md"\nrequires-python = ">=3.8"\ndependencies = ["foo (==1.19.2)", "pendulum (>=2.0.0,<3.0.0)"]\n\n[tool.poetry]\n\n[tool.poetry.group.dev.dependencies]\npytest = "3.6.0"\n\n[build-system]\nrequires = ["poetry-core>=2.0.0,<3.0.0"]\nbuild-backend = "poetry.core.masonry.api"\n\n\n'
E + where '\nThis command will guide you through creating your pyproject.toml config.\n\n\n You can specify a package in the following forms:\n - A single name (requests): this will search for matches on PyPI\n - A name and a constraint (requests@^2.23.0)\n - A git url (git+https://github.com/python-poetry/poetry.git)\n - A git url with a revision (git+https://github.com/python-poetry/poetry.git#develop)\n - A file path (../my-package/my-package.whl)\n - A directory (../my-package/)\n - A url (https://example.com/packages/my-package-0.1.0.tar.gz)\n \nAdding foo 1.19.2\nAdding pendulum@^2.0.0\n\nAdding pytest 3.6.0\nAdding [email protected]\n\nGenerated file\n\n[project]\nname = "my-package"\nversion = "1.2.3"\ndescription = "This is a description"\nauthors = [\n {name = "Your Name",email = "[email protected]"}\n]\nlicense = {text = "MIT"}\nreadme = "README.md"\nrequires-python = ">=3.8"\ndependencies = ["foo (==1.19.2)", "pendulum (>=2.0.0,<3.0.0)"]\n\n[tool.poetry]\n\n[tool.poetry.group.dev.dependencies]\npytest = "3.6.0"\n\n[build-system]\nrequires = ["poetry-core>=2.0.0,<3.0.0"]\nbuild-backend = "poetry.core.masonry.api"\n\n\n' = fetch_output()
E + where fetch_output = <cleo.io.buffered_io.BufferedIO object at 0x31c0b452c410>.fetch_output
E + where <cleo.io.buffered_io.BufferedIO object at 0x31c0b452c410> = <cleo.testers.command_tester.CommandTester object at 0x31c0b4b26a50>.io
/tmp/cirrus-ci-build/tests/console/commands/test_init.py:648: AssertionError
Check failure on line 1099 in tests/console/commands/test_init.py
cirrus-ci / Tests / FreeBSD (Python 3.11) / pytest
tests/console/commands/test_init.py#L1099
tests.console.commands.test_init.test_package_include[mypackage-None]
Raw output
tester = <cleo.testers.command_tester.CommandTester object at 0x31c0b72c8c50>
package_name = 'mypackage', include = None
@pytest.mark.parametrize(
"package_name, include",
(
("mypackage", None),
("my-package", "my_package"),
("my.package", "my"),
("my-awesome-package", "my_awesome_package"),
("my.awesome.package", "my"),
),
)
def test_package_include(
tester: CommandTester,
package_name: str,
include: str | None,
) -> None:
tester.execute(
inputs="\n".join(
(
package_name,
"", # Version
"", # Description
"poetry", # Author
"", # License
">=3.10", # Python
"n", # Interactive packages
"n", # Interactive dev packages
"\n", # Generate
),
),
)
packages = ""
if include and module_name(package_name) != include:
packages = f'\n[tool.poetry]\npackages = [{{include = "{include}"}}]\n'
expected = (
"[project]\n"
f'name = "{package_name.replace(".", "-")}"\n' # canonicalized
'version = "0.1.0"\n'
'description = ""\n'
"authors = [\n"
' {name = "poetry"}\n'
"]\n"
'readme = "README.md"\n'
'requires-python = ">=3.10"\n'
"dependencies = [\n"
"]\n"
f"{packages}" # This line is optional. Thus, no newline here.
)
> assert expected in tester.io.fetch_output()
E assert '[project]\nname = "mypackage"\nversion = "0.1.0"\ndescription = ""\nauthors = [\n {name = "poetry"}\n]\nreadme = "README.md"\nrequires-python = ">=3.10"\ndependencies = [\n]\n' in '\nThis command will guide you through creating your pyproject.toml config.\n\n\nGenerated file\n\n[project]\nname = "mypackage"\nversion = "0.1.0"\ndescription = ""\nauthors = [\n {name = "poetry"}\n]\nreadme = "README.md"\nrequires-python = ">=3.10"\ndependencies = []\n\n\n[build-system]\nrequires = ["poetry-core>=2.0.0,<3.0.0"]\nbuild-backend = "poetry.core.masonry.api"\n\n\n'
E + where '\nThis command will guide you through creating your pyproject.toml config.\n\n\nGenerated file\n\n[project]\nname = "mypackage"\nversion = "0.1.0"\ndescription = ""\nauthors = [\n {name = "poetry"}\n]\nreadme = "README.md"\nrequires-python = ">=3.10"\ndependencies = []\n\n\n[build-system]\nrequires = ["poetry-core>=2.0.0,<3.0.0"]\nbuild-backend = "poetry.core.masonry.api"\n\n\n' = fetch_output()
E + where fetch_output = <cleo.io.buffered_io.BufferedIO object at 0x31c0b713ce10>.fetch_output
E + where <cleo.io.buffered_io.BufferedIO object at 0x31c0b713ce10> = <cleo.testers.command_tester.CommandTester object at 0x31c0b72c8c50>.io
/tmp/cirrus-ci-build/tests/console/commands/test_init.py:1099: AssertionError
Check failure on line 287 in tests/console/commands/test_init.py
cirrus-ci / Tests / FreeBSD (Python 3.11) / pytest
tests/console/commands/test_init.py#L287
tests.console.commands.test_init.test_interactive_with_git_dependencies
Raw output
tester = <cleo.testers.command_tester.CommandTester object at 0x31c0b70a1ed0>
repo = <tests.helpers.TestRepository object at 0x31c0b718f290>
def test_interactive_with_git_dependencies(
tester: CommandTester, repo: TestRepository
) -> None:
repo.add_package(get_package("pendulum", "2.0.0"))
repo.add_package(get_package("pytest", "3.6.0"))
inputs = [
"my-package", # Package name
"1.2.3", # Version
"This is a description", # Description
"n", # Author
"MIT", # License
">=3.6", # Python
"", # Interactive packages
"git+https://github.com/demo/demo.git", # Search for package
"", # Stop searching for packages
"", # Interactive dev packages
"pytest", # Search for package
"0",
"",
"",
"\n", # Generate
]
tester.execute(inputs="\n".join(inputs))
expected = """\
[project]
name = "my-package"
version = "1.2.3"
description = "This is a description"
authors = [
{name = "Your Name",email = "[email protected]"}
]
license = {text = "MIT"}
readme = "README.md"
requires-python = ">=3.6"
dependencies = [
"demo @ git+https://github.com/demo/demo.git"
]
[tool.poetry]
[tool.poetry.group.dev.dependencies]
pytest = "^3.6.0"
"""
> assert expected in tester.io.fetch_output()
E assert '[project]\nname = "my-package"\nversion = "1.2.3"\ndescription = "This is a description"\nauthors = [\n {name = "Your Name",email = "[email protected]"}\n]\nlicense = {text = "MIT"}\nreadme = "README.md"\nrequires-python = ">=3.6"\ndependencies = [\n "demo @ git+https://github.com/demo/demo.git"\n]\n\n[tool.poetry]\n\n[tool.poetry.group.dev.dependencies]\npytest = "^3.6.0"\n' in '\nThis command will guide you through creating your pyproject.toml config.\n\n\n You can specify a package in the following forms:\n - A single name (requests): this will search for matches on PyPI\n - A name and a constraint (requests@^2.23.0)\n - A git url (git+https://github.com/python-poetry/poetry.git)\n - A git url with a revision (git+https://github.com/python-poetry/poetry.git#develop)\n - A file path (../my-package/my-package.whl)\n - A directory (../my-package/)\n - A url (https://example.com/packages/my-package-0.1.0.tar.gz)\n \nAdding git+https://github.com/demo/demo.git\n\nFound 1 packages matching pytest\nUsing version ^3.6.0 for pytest\n\nGenerated file\n\n[project]\nname = "my-package"\nversion = "1.2.3"\ndescription = "This is a description"\nauthors = [\n {name = "Your Name",email = "[email protected]"}\n]\nlicense = {text = "MIT"}\nreadme = "README.md"\nrequires-python = ">=3.6"\ndependencies = ["demo @ git+https://github.com/demo/demo.git"]\n\n[tool.poetry]\n\n[tool.poetry.group.dev.dependencies]\npytest = "^3.6.0"\n\n[build-system]\nrequires = ["poetry-core>=2.0.0,<3.0.0"]\nbuild-backend = "poetry.core.masonry.api"\n\n\n'
E + where '\nThis command will guide you through creating your pyproject.toml config.\n\n\n You can specify a package in the following forms:\n - A single name (requests): this will search for matches on PyPI\n - A name and a constraint (requests@^2.23.0)\n - A git url (git+https://github.com/python-poetry/poetry.git)\n - A git url with a revision (git+https://github.com/python-poetry/poetry.git#develop)\n - A file path (../my-package/my-package.whl)\n - A directory (../my-package/)\n - A url (https://example.com/packages/my-package-0.1.0.tar.gz)\n \nAdding git+https://github.com/demo/demo.git\n\nFound 1 packages matching pytest\nUsing version ^3.6.0 for pytest\n\nGenerated file\n\n[project]\nname = "my-package"\nversion = "1.2.3"\ndescription = "This is a description"\nauthors = [\n {name = "Your Name",email = "[email protected]"}\n]\nlicense = {text = "MIT"}\nreadme = "README.md"\nrequires-python = ">=3.6"\ndependencies = ["demo @ git+https://github.com/demo/demo.git"]\n\n[tool.poetry]\n\n[tool.poetry.group.dev.dependencies]\npytest = "^3.6.0"\n\n[build-system]\nrequires = ["poetry-core>=2.0.0,<3.0.0"]\nbuild-backend = "poetry.core.masonry.api"\n\n\n' = fetch_output()
E + where fetch_output = <cleo.io.buffered_io.BufferedIO object at 0x31c0b70a0350>.fetch_output
E + where <cleo.io.buffered_io.BufferedIO object at 0x31c0b70a0350> = <cleo.testers.command_tester.CommandTester object at 0x31c0b70a1ed0>.io
/tmp/cirrus-ci-build/tests/console/commands/test_init.py:287: AssertionError
Check failure on line 1099 in tests/console/commands/test_init.py
cirrus-ci / Tests / FreeBSD (Python 3.11) / pytest
tests/console/commands/test_init.py#L1099
tests.console.commands.test_init.test_package_include[my-package-my_package]
Raw output
tester = <cleo.testers.command_tester.CommandTester object at 0x157f696bcc90>
package_name = 'my-package', include = 'my_package'
@pytest.mark.parametrize(
"package_name, include",
(
("mypackage", None),
("my-package", "my_package"),
("my.package", "my"),
("my-awesome-package", "my_awesome_package"),
("my.awesome.package", "my"),
),
)
def test_package_include(
tester: CommandTester,
package_name: str,
include: str | None,
) -> None:
tester.execute(
inputs="\n".join(
(
package_name,
"", # Version
"", # Description
"poetry", # Author
"", # License
">=3.10", # Python
"n", # Interactive packages
"n", # Interactive dev packages
"\n", # Generate
),
),
)
packages = ""
if include and module_name(package_name) != include:
packages = f'\n[tool.poetry]\npackages = [{{include = "{include}"}}]\n'
expected = (
"[project]\n"
f'name = "{package_name.replace(".", "-")}"\n' # canonicalized
'version = "0.1.0"\n'
'description = ""\n'
"authors = [\n"
' {name = "poetry"}\n'
"]\n"
'readme = "README.md"\n'
'requires-python = ">=3.10"\n'
"dependencies = [\n"
"]\n"
f"{packages}" # This line is optional. Thus, no newline here.
)
> assert expected in tester.io.fetch_output()
E assert '[project]\nname = "my-package"\nversion = "0.1.0"\ndescription = ""\nauthors = [\n {name = "poetry"}\n]\nreadme = "README.md"\nrequires-python = ">=3.10"\ndependencies = [\n]\n' in '\nThis command will guide you through creating your pyproject.toml config.\n\n\nGenerated file\n\n[project]\nname = "my-package"\nversion = "0.1.0"\ndescription = ""\nauthors = [\n {name = "poetry"}\n]\nreadme = "README.md"\nrequires-python = ">=3.10"\ndependencies = []\n\n\n[build-system]\nrequires = ["poetry-core>=2.0.0,<3.0.0"]\nbuild-backend = "poetry.core.masonry.api"\n\n\n'
E + where '\nThis command will guide you through creating your pyproject.toml config.\n\n\nGenerated file\n\n[project]\nname = "my-package"\nversion = "0.1.0"\ndescription = ""\nauthors = [\n {name = "poetry"}\n]\nreadme = "README.md"\nrequires-python = ">=3.10"\ndependencies = []\n\n\n[build-system]\nrequires = ["poetry-core>=2.0.0,<3.0.0"]\nbuild-backend = "poetry.core.masonry.api"\n\n\n' = fetch_output()
E + where fetch_output = <cleo.io.buffered_io.BufferedIO object at 0x157f68396fd0>.fetch_output
E + where <cleo.io.buffered_io.BufferedIO object at 0x157f68396fd0> = <cleo.testers.command_tester.CommandTester object at 0x157f696bcc90>.io
/tmp/cirrus-ci-build/tests/console/commands/test_init.py:1099: AssertionError
Check failure on line 432 in tests/console/commands/test_init.py
cirrus-ci / Tests / FreeBSD (Python 3.11) / pytest
tests/console/commands/test_init.py#L432
tests.console.commands.test_init.test_interactive_with_git_dependencies_and_other_name
Raw output
tester = <cleo.testers.command_tester.CommandTester object at 0x157f666312d0>
repo = <tests.helpers.TestRepository object at 0x157f66949fd0>
def test_interactive_with_git_dependencies_and_other_name(
tester: CommandTester, repo: TestRepository
) -> None:
repo.add_package(get_package("pendulum", "2.0.0"))
repo.add_package(get_package("pytest", "3.6.0"))
inputs = [
"my-package", # Package name
"1.2.3", # Version
"This is a description", # Description
"n", # Author
"MIT", # License
">=3.6", # Python
"", # Interactive packages
"git+https://github.com/demo/pyproject-demo.git", # Search for package
"", # Stop searching for packages
"", # Interactive dev packages
"pytest", # Search for package
"0",
"",
"",
"\n", # Generate
]
tester.execute(inputs="\n".join(inputs))
expected = """\
[project]
name = "my-package"
version = "1.2.3"
description = "This is a description"
authors = [
{name = "Your Name",email = "[email protected]"}
]
license = {text = "MIT"}
readme = "README.md"
requires-python = ">=3.6"
dependencies = [
"demo @ git+https://github.com/demo/pyproject-demo.git"
]
[tool.poetry]
[tool.poetry.group.dev.dependencies]
pytest = "^3.6.0"
"""
> assert expected in tester.io.fetch_output()
E assert '[project]\nname = "my-package"\nversion = "1.2.3"\ndescription = "This is a description"\nauthors = [\n {name = "Your Name",email = "[email protected]"}\n]\nlicense = {text = "MIT"}\nreadme = "README.md"\nrequires-python = ">=3.6"\ndependencies = [\n "demo @ git+https://github.com/demo/pyproject-demo.git"\n]\n\n[tool.poetry]\n\n[tool.poetry.group.dev.dependencies]\npytest = "^3.6.0"\n' in '\nThis command will guide you through creating your pyproject.toml config.\n\n\n You can specify a package in the following forms:\n - A single name (requests): this will search for matches on PyPI\n - A name and a constraint (requests@^2.23.0)\n - A git url (git+https://github.com/python-poetry/poetry.git)\n - A git url with a revision (git+https://github.com/python-poetry/poetry.git#develop)\n - A file path (../my-package/my-package.whl)\n - A directory (../my-package/)\n - A url (https://example.com/packages/my-package-0.1.0.tar.gz)\n \nAdding git+https://github.com/demo/pyproject-demo.git\n\nFound 1 packages matching pytest\nUsing version ^3.6.0 for pytest\n\nGenerated file\n\n[project]\nname = "my-package"\nversion = "1.2.3"\ndescription = "This is a description"\nauthors = [\n {name = "Your Name",email = "[email protected]"}\n]\nlicense = {text = "MIT"}\nreadme = "README.md"\nrequires-python = ">=3.6"\ndependencies = ["demo @ git+https://github.com/demo/pyproject-demo.git"]\n\n[tool.poetry]\n\n[tool.poetry.group.dev.dependencies]\npytest = "^3.6.0"\n\n[build-system]\nrequires = ["poetry-core>=2.0.0,<3.0.0"]\nbuild-backend = "poetry.core.masonry.api"\n\n\n'
E + where '\nThis command will guide you through creating your pyproject.toml config.\n\n\n You can specify a package in the following forms:\n - A single name (requests): this will search for matches on PyPI\n - A name and a constraint (requests@^2.23.0)\n - A git url (git+https://github.com/python-poetry/poetry.git)\n - A git url with a revision (git+https://github.com/python-poetry/poetry.git#develop)\n - A file path (../my-package/my-package.whl)\n - A directory (../my-package/)\n - A url (https://example.com/packages/my-package-0.1.0.tar.gz)\n \nAdding git+https://github.com/demo/pyproject-demo.git\n\nFound 1 packages matching pytest\nUsing version ^3.6.0 for pytest\n\nGenerated file\n\n[project]\nname = "my-package"\nversion = "1.2.3"\ndescription = "This is a description"\nauthors = [\n {name = "Your Name",email = "[email protected]"}\n]\nlicense = {text = "MIT"}\nreadme = "README.md"\nrequires-python = ">=3.6"\ndependencies = ["demo @ git+https://github.com/demo/pyproject-demo.git"]\n\n[tool.poetry]\n\n[tool.poetry.group.dev.dependencies]\npytest = "^3.6.0"\n\n[build-system]\nrequires = ["poetry-core>=2.0.0,<3.0.0"]\nbuild-backend = "poetry.core.masonry.api"\n\n\n' = fetch_output()
E + where fetch_output = <cleo.io.buffered_io.BufferedIO object at 0x157f66633c10>.fetch_output
E + where <cleo.io.buffered_io.BufferedIO object at 0x157f66633c10> = <cleo.testers.command_tester.CommandTester object at 0x157f666312d0>.io
/tmp/cirrus-ci-build/tests/console/commands/test_init.py:432: AssertionError
Check failure on line 487 in tests/console/commands/test_init.py
cirrus-ci / Tests / FreeBSD (Python 3.11) / pytest
tests/console/commands/test_init.py#L487
tests.console.commands.test_init.test_interactive_with_directory_dependency
Raw output
tester = <cleo.testers.command_tester.CommandTester object at 0x31c0b70b3950>
repo = <tests.helpers.TestRepository object at 0x31c0b544bb90>
source_dir = PosixPath('/tmp/pytest-of-root/pytest-0/popen-gw0/test_interactive_with_director1')
fixture_dir = <function fixture_dir.<locals>._fixture_dir at 0x31c0b4934900>
def test_interactive_with_directory_dependency(
tester: CommandTester,
repo: TestRepository,
source_dir: Path,
fixture_dir: FixtureDirGetter,
) -> None:
repo.add_package(get_package("pendulum", "2.0.0"))
repo.add_package(get_package("pytest", "3.6.0"))
demo = fixture_dir("git") / "github.com" / "demo" / "demo"
shutil.copytree(str(demo), str(source_dir / "demo"))
inputs = [
"my-package", # Package name
"1.2.3", # Version
"This is a description", # Description
"n", # Author
"MIT", # License
">=3.6", # Python
"", # Interactive packages
"./demo", # Search for package
"", # Stop searching for packages
"", # Interactive dev packages
"pytest", # Search for package
"0",
"",
"",
"\n", # Generate
]
tester.execute(inputs="\n".join(inputs))
demo_uri = (Path.cwd() / "demo").as_uri()
expected = f"""\
[project]
name = "my-package"
version = "1.2.3"
description = "This is a description"
authors = [
{{name = "Your Name",email = "[email protected]"}}
]
license = {{text = "MIT"}}
readme = "README.md"
requires-python = ">=3.6"
dependencies = [
"demo @ {demo_uri}"
]
[tool.poetry]
[tool.poetry.group.dev.dependencies]
pytest = "^3.6.0"
"""
> assert expected in tester.io.fetch_output()
E assert '[project]\nname = "my-package"\nversion = "1.2.3"\ndescription = "This is a description"\nauthors = [\n {name = "Your Name",email = "[email protected]"}\n]\nlicense = {text = "MIT"}\nreadme = "README.md"\nrequires-python = ">=3.6"\ndependencies = [\n "demo @ file:///tmp/pytest-of-root/pytest-0/popen-gw0/test_interactive_with_director1/demo"\n]\n\n[tool.poetry]\n\n[tool.poetry.group.dev.dependencies]\npytest = "^3.6.0"\n' in '\nThis command will guide you through creating your pyproject.toml config.\n\n\n You can specify a package in the following forms:\n - A single name (requests): this will search for matches on PyPI\n - A name and a constraint (requests@^2.23.0)\n - A git url (git+https://github.com/python-poetry/poetry.git)\n - A git url with a revision (git+https://github.com/python-poetry/poetry.git#develop)\n - A file path (../my-package/my-package.whl)\n - A directory (../my-package/)\n - A url (https://example.com/packages/my-package-0.1.0.tar.gz)\n \nAdding ./demo\n\nFound 1 packages matching pytest\nUsing version ^3.6.0 for pytest\n\nGenerated file\n\n[project]\nname = "my-package"\nversion = "1.2.3"\ndescription = "This is a description"\nauthors = [\n {name = "Your Name",email = "[email protected]"}\n]\nlicense = {text = "MIT"}\nreadme = "README.md"\nrequires-python = ">=3.6"\ndependencies = ["demo @ file:///tmp/pytest-of-root/pytest-0/popen-gw0/test_interactive_with_director1/demo"]\n\n[tool.poetry]\n\n[tool.poetry.group.dev.dependencies]\npytest = "^3.6.0"\n\n[build-system]\nrequires = ["poetry-core>=2.0.0,<3.0.0"]\nbuild-backend = "poetry.core.masonry.api"\n\n\n'
E + where '\nThis command will guide you through creating your pyproject.toml config.\n\n\n You can specify a package in the following forms:\n - A single name (requests): this will search for matches on PyPI\n - A name and a constraint (requests@^2.23.0)\n - A git url (git+https://github.com/python-poetry/poetry.git)\n - A git url with a revision (git+https://github.com/python-poetry/poetry.git#develop)\n - A file path (../my-package/my-package.whl)\n - A directory (../my-package/)\n - A url (https://example.com/packages/my-package-0.1.0.tar.gz)\n \nAdding ./demo\n\nFound 1 packages matching pytest\nUsing version ^3.6.0 for pytest\n\nGenerated file\n\n[project]\nname = "my-package"\nversion = "1.2.3"\ndescription = "This is a description"\nauthors = [\n {name = "Your Name",email = "[email protected]"}\n]\nlicense = {text = "MIT"}\nreadme = "README.md"\nrequires-python = ">=3.6"\ndependencies = ["demo @ file:///tmp/pytest-of-root/pytest-0/popen-gw0/test_interactive_with_director1/demo"]\n\n[tool.poetry]\n\n[tool.poetry.group.dev.dependencies]\npytest = "^3.6.0"\n\n[build-system]\nrequires = ["poetry-core>=2.0.0,<3.0.0"]\nbuild-backend = "poetry.core.masonry.api"\n\n\n' = fetch_output()
E + where fetch_output = <cleo.io.buffered_io.BufferedIO object at 0x31c0b70b2450>.fetch_output
E + where <cleo.io.buffered_io.BufferedIO object at 0x31c0b70b2450> = <cleo.testers.command_tester.CommandTester object at 0x31c0b70b3950>.io
/tmp/cirrus-ci-build/tests/console/commands/test_init.py:487: AssertionError
Check failure on line 166 in tests/console/commands/test_init.py
cirrus-ci / Tests / FreeBSD (Python 3.11) / pytest
tests/console/commands/test_init.py#L166
tests.console.commands.test_init.test_interactive_with_dependencies
Raw output
tester = <cleo.testers.command_tester.CommandTester object at 0x157f668b3450>
repo = <tests.helpers.TestRepository object at 0x157f698e1d50>
def test_interactive_with_dependencies(
tester: CommandTester, repo: TestRepository
) -> None:
repo.add_package(get_package("django-pendulum", "0.1.6-pre4"))
repo.add_package(get_package("pendulum", "2.0.0"))
repo.add_package(get_package("pytest", "3.6.0"))
repo.add_package(get_package("flask", "2.0.0"))
inputs = [
"my-package", # Package name
"1.2.3", # Version
"This is a description", # Description
"n", # Author
"MIT", # License
">=3.6", # Python
"", # Interactive packages
"pendulu", # Search for package
"1", # Second option is pendulum
"", # Do not set constraint
"Flask",
"0",
"",
"", # Stop searching for packages
"", # Interactive dev packages
"pytest", # Search for package
"0",
"",
"",
"\n", # Generate
]
tester.execute(inputs="\n".join(inputs))
expected = """\
[project]
name = "my-package"
version = "1.2.3"
description = "This is a description"
authors = [
{name = "Your Name",email = "[email protected]"}
]
license = {text = "MIT"}
readme = "README.md"
requires-python = ">=3.6"
dependencies = [
"pendulum (>=2.0.0,<3.0.0)",
"flask (>=2.0.0,<3.0.0)"
]
[tool.poetry]
[tool.poetry.group.dev.dependencies]
pytest = "^3.6.0"
[build-system]
requires = ["poetry-core>=2.0.0,<3.0.0"]
build-backend = "poetry.core.masonry.api"
"""
> assert expected in tester.io.fetch_output()
E assert '[project]\nname = "my-package"\nversion = "1.2.3"\ndescription = "This is a description"\nauthors = [\n {name = "Your Name",email = "[email protected]"}\n]\nlicense = {text = "MIT"}\nreadme = "README.md"\nrequires-python = ">=3.6"\ndependencies = [\n "pendulum (>=2.0.0,<3.0.0)",\n "flask (>=2.0.0,<3.0.0)"\n]\n\n[tool.poetry]\n\n[tool.poetry.group.dev.dependencies]\npytest = "^3.6.0"\n\n[build-system]\nrequires = ["poetry-core>=2.0.0,<3.0.0"]\nbuild-backend = "poetry.core.masonry.api"\n' in '\nThis command will guide you through creating your pyproject.toml config.\n\n\n You can specify a package in the following forms:\n - A single name (requests): this will search for matches on PyPI\n - A name and a constraint (requests@^2.23.0)\n - A git url (git+https://github.com/python-poetry/poetry.git)\n - A git url with a revision (git+https://github.com/python-poetry/poetry.git#develop)\n - A file path (../my-package/my-package.whl)\n - A directory (../my-package/)\n - A url (https://example.com/packages/my-package-0.1.0.tar.gz)\n \nFound 2 packages matching pendulu\nUsing version ^2.0.0 for pendulum\nFound 1 packages matching Flask\nUsing version ^2.0.0 for flask\n\nFound 1 packages matching pytest\nUsing version ^3.6.0 for pytest\n\nGenerated file\n\n[project]\nname = "my-package"\nversion = "1.2.3"\ndescription = "This is a description"\nauthors = [\n {name = "Your Name",email = "[email protected]"}\n]\nlicense = {text = "MIT"}\nreadme = "README.md"\nrequires-python = ">=3.6"\ndependencies = ["pendulum (>=2.0.0,<3.0.0)", "flask (>=2.0.0,<3.0.0)"]\n\n[tool.poetry]\n\n[tool.poetry.group.dev.dependencies]\npytest = "^3.6.0"\n\n[build-system]\nrequires = ["poetry-core>=2.0.0,<3.0.0"]\nbuild-backend = "poetry.core.masonry.api"\n\n\n'
E + where '\nThis command will guide you through creating your pyproject.toml config.\n\n\n You can specify a package in the following forms:\n - A single name (requests): this will search for matches on PyPI\n - A name and a constraint (requests@^2.23.0)\n - A git url (git+https://github.com/python-poetry/poetry.git)\n - A git url with a revision (git+https://github.com/python-poetry/poetry.git#develop)\n - A file path (../my-package/my-package.whl)\n - A directory (../my-package/)\n - A url (https://example.com/packages/my-package-0.1.0.tar.gz)\n \nFound 2 packages matching pendulu\nUsing version ^2.0.0 for pendulum\nFound 1 packages matching Flask\nUsing version ^2.0.0 for flask\n\nFound 1 packages matching pytest\nUsing version ^3.6.0 for pytest\n\nGenerated file\n\n[project]\nname = "my-package"\nversion = "1.2.3"\ndescription = "This is a description"\nauthors = [\n {name = "Your Name",email = "[email protected]"}\n]\nlicense = {text = "MIT"}\nreadme = "README.md"\nrequires-python = ">=3.6"\ndependencies = ["pendulum (>=2.0.0,<3.0.0)", "flask (>=2.0.0,<3.0.0)"]\n\n[tool.poetry]\n\n[tool.poetry.group.dev.dependencies]\npytest = "^3.6.0"\n\n[build-system]\nrequires = ["poetry-core>=2.0.0,<3.0.0"]\nbuild-backend = "poetry.core.masonry.api"\n\n\n' = fetch_output()
E + where fetch_output = <cleo.io.buffered_io.BufferedIO object at 0x157f668b1410>.fetch_output
E + where <cleo.io.buffered_io.BufferedIO object at 0x157f668b1410> = <cleo.testers.command_tester.CommandTester object at 0x157f668b3450>.io
/tmp/cirrus-ci-build/tests/console/commands/test_init.py:166: AssertionError
Check failure on line 1099 in tests/console/commands/test_init.py
cirrus-ci / Tests / FreeBSD (Python 3.11) / pytest
tests/console/commands/test_init.py#L1099
tests.console.commands.test_init.test_package_include[my.awesome.package-my]
Raw output
tester = <cleo.testers.command_tester.CommandTester object at 0x31c0b801e250>
package_name = 'my.awesome.package', include = 'my'
@pytest.mark.parametrize(
"package_name, include",
(
("mypackage", None),
("my-package", "my_package"),
("my.package", "my"),
("my-awesome-package", "my_awesome_package"),
("my.awesome.package", "my"),
),
)
def test_package_include(
tester: CommandTester,
package_name: str,
include: str | None,
) -> None:
tester.execute(
inputs="\n".join(
(
package_name,
"", # Version
"", # Description
"poetry", # Author
"", # License
">=3.10", # Python
"n", # Interactive packages
"n", # Interactive dev packages
"\n", # Generate
),
),
)
packages = ""
if include and module_name(package_name) != include:
packages = f'\n[tool.poetry]\npackages = [{{include = "{include}"}}]\n'
expected = (
"[project]\n"
f'name = "{package_name.replace(".", "-")}"\n' # canonicalized
'version = "0.1.0"\n'
'description = ""\n'
"authors = [\n"
' {name = "poetry"}\n'
"]\n"
'readme = "README.md"\n'
'requires-python = ">=3.10"\n'
"dependencies = [\n"
"]\n"
f"{packages}" # This line is optional. Thus, no newline here.
)
> assert expected in tester.io.fetch_output()
E assert '[project]\nname = "my-awesome-package"\nversion = "0.1.0"\ndescription = ""\nauthors = [\n {name = "poetry"}\n]\nreadme = "README.md"\nrequires-python = ">=3.10"\ndependencies = [\n]\n\n[tool.poetry]\npackages = [{include = "my"}]\n' in '\nThis command will guide you through creating your pyproject.toml config.\n\n\nGenerated file\n\n[project]\nname = "my-awesome-package"\nversion = "0.1.0"\ndescription = ""\nauthors = [\n {name = "poetry"}\n]\nreadme = "README.md"\nrequires-python = ">=3.10"\ndependencies = []\n\n[tool.poetry]\npackages = [{include = "my"}]\n\n\n[build-system]\nrequires = ["poetry-core>=2.0.0,<3.0.0"]\nbuild-backend = "poetry.core.masonry.api"\n\n\n'
E + where '\nThis command will guide you through creating your pyproject.toml config.\n\n\nGenerated file\n\n[project]\nname = "my-awesome-package"\nversion = "0.1.0"\ndescription = ""\nauthors = [\n {name = "poetry"}\n]\nreadme = "README.md"\nrequires-python = ">=3.10"\ndependencies = []\n\n[tool.poetry]\npackages = [{include = "my"}]\n\n\n[build-system]\nrequires = ["poetry-core>=2.0.0,<3.0.0"]\nbuild-backend = "poetry.core.masonry.api"\n\n\n' = fetch_output()
E + where fetch_output = <cleo.io.buffered_io.BufferedIO object at 0x31c0b801ec90>.fetch_output
E + where <cleo.io.buffered_io.BufferedIO object at 0x31c0b801ec90> = <cleo.testers.command_tester.CommandTester object at 0x31c0b801e250>.io
/tmp/cirrus-ci-build/tests/console/commands/test_init.py:1099: AssertionError
Check failure on line 985 in tests/console/commands/test_init.py
cirrus-ci / Tests / FreeBSD (Python 3.11) / pytest
tests/console/commands/test_init.py#L985
tests.console.commands.test_init.test_init_non_interactive_existing_pyproject_add_dependency
Raw output
tester = <cleo.testers.command_tester.CommandTester object at 0x31c0b7234f90>
source_dir = PosixPath('/tmp/pytest-of-root/pytest-0/popen-gw0/test_init_non_interactive_exis0')
init_basic_inputs = 'my-package\n1.2.3\nThis is a description\nn\nMIT\n>=3.6\nn\nn\n\n'
repo = <tests.helpers.TestRepository object at 0x31c0b6770050>
def test_init_non_interactive_existing_pyproject_add_dependency(
tester: CommandTester,
source_dir: Path,
init_basic_inputs: str,
repo: TestRepository,
) -> None:
pyproject_file = source_dir / "pyproject.toml"
existing_section = """
[tool.black]
line-length = 88
"""
pyproject_file.write_text(existing_section, encoding="utf-8")
repo.add_package(get_package("foo", "1.19.2"))
tester.execute(
"--author 'Your Name <[email protected]>' "
"--name 'my-package' "
"--python '>=3.6' "
"--dependency foo",
interactive=False,
)
expected = """\
[project]
name = "my-package"
version = "0.1.0"
description = ""
authors = [
{name = "Your Name",email = "[email protected]"}
]
readme = "README.md"
requires-python = ">=3.6"
dependencies = [
"foo (>=1.19.2,<2.0.0)"
]
"""
> assert f"{existing_section}\n{expected}" in pyproject_file.read_text(
encoding="utf-8"
)
E assert '\n[tool.black]\nline-length = 88\n\n[project]\nname = "my-package"\nversion = "0.1.0"\ndescription = ""\nauthors = [\n {name = "Your Name",email = "[email protected]"}\n]\nreadme = "README.md"\nrequires-python = ">=3.6"\ndependencies = [\n "foo (>=1.19.2,<2.0.0)"\n]\n' in '\n[tool.black]\nline-length = 88\n\n[project]\nname = "my-package"\nversion = "0.1.0"\ndescription = ""\nauthors = [\n {name = "Your Name",email = "[email protected]"}\n]\nreadme = "README.md"\nrequires-python = ">=3.6"\ndependencies = ["foo (>=1.19.2,<2.0.0)"]\n\n\n[build-system]\nrequires = ["poetry-core>=2.0.0,<3.0.0"]\nbuild-backend = "poetry.core.masonry.api"\n'
E + where '\n[tool.black]\nline-length = 88\n\n[project]\nname = "my-package"\nversion = "0.1.0"\ndescription = ""\nauthors = [\n {name = "Your Name",email = "[email protected]"}\n]\nreadme = "README.md"\nrequires-python = ">=3.6"\ndependencies = ["foo (>=1.19.2,<2.0.0)"]\n\n\n[build-system]\nrequires = ["poetry-core>=2.0.0,<3.0.0"]\nbuild-backend = "poetry.core.masonry.api"\n' = read_text(encoding='utf-8')
E + where read_text = PosixPath('/tmp/pytest-of-root/pytest-0/popen-gw0/test_init_non_interactive_exis0/pyproject.toml').read_text
/tmp/cirrus-ci-build/tests/console/commands/test_init.py:985: AssertionError
Check failure on line 599 in tests/console/commands/test_init.py
cirrus-ci / Tests / FreeBSD (Python 3.11) / pytest
tests/console/commands/test_init.py#L599
tests.console.commands.test_init.test_interactive_with_file_dependency
Raw output
tester = <cleo.testers.command_tester.CommandTester object at 0x157f6915edd0>
repo = <tests.helpers.TestRepository object at 0x157f69170b50>
source_dir = PosixPath('/tmp/pytest-of-root/pytest-0/popen-gw1/test_interactive_with_file_dep0')
fixture_dir = <function fixture_dir.<locals>._fixture_dir at 0x157f60ed9b20>
def test_interactive_with_file_dependency(
tester: CommandTester,
repo: TestRepository,
source_dir: Path,
fixture_dir: FixtureDirGetter,
) -> None:
repo.add_package(get_package("pendulum", "2.0.0"))
repo.add_package(get_package("pytest", "3.6.0"))
demo = fixture_dir("distributions") / "demo-0.1.0-py2.py3-none-any.whl"
shutil.copyfile(str(demo), str(source_dir / demo.name))
inputs = [
"my-package", # Package name
"1.2.3", # Version
"This is a description", # Description
"n", # Author
"MIT", # License
">=3.6", # Python
"", # Interactive packages
"./demo-0.1.0-py2.py3-none-any.whl", # Search for package
"", # Stop searching for packages
"", # Interactive dev packages
"pytest", # Search for package
"0",
"",
"",
"\n", # Generate
]
tester.execute(inputs="\n".join(inputs))
demo_uri = (Path.cwd() / "demo-0.1.0-py2.py3-none-any.whl").as_uri()
expected = f"""\
[project]
name = "my-package"
version = "1.2.3"
description = "This is a description"
authors = [
{{name = "Your Name",email = "[email protected]"}}
]
license = {{text = "MIT"}}
readme = "README.md"
requires-python = ">=3.6"
dependencies = [
"demo @ {demo_uri}"
]
[tool.poetry]
[tool.poetry.group.dev.dependencies]
pytest = "^3.6.0"
"""
> assert expected in tester.io.fetch_output()
E assert '[project]\nname = "my-package"\nversion = "1.2.3"\ndescription = "This is a description"\nauthors = [\n {name = "Your Name",email = "[email protected]"}\n]\nlicense = {text = "MIT"}\nreadme = "README.md"\nrequires-python = ">=3.6"\ndependencies = [\n "demo @ file:///tmp/pytest-of-root/pytest-0/popen-gw1/test_interactive_with_file_dep0/demo-0.1.0-py2.py3-none-any.whl"\n]\n\n[tool.poetry]\n\n[tool.poetry.group.dev.dependencies]\npytest = "^3.6.0"\n' in '\nThis command will guide you through creating your pyproject.toml config.\n\n\n You can specify a package in the following forms:\n - A single name (requests): this will search for matches on PyPI\n - A name and a constraint (requests@^2.23.0)\n - A git url (git+https://github.com/python-poetry/poetry.git)\n - A git url with a revision (git+https://github.com/python-poetry/poetry.git#develop)\n - A file path (../my-package/my-package.whl)\n - A directory (../my-package/)\n - A url (https://example.com/packages/my-package-0.1.0.tar.gz)\n \nAdding ./demo-0.1.0-py2.py3-none-any.whl\n\nFound 1 packages matching pytest\nUsing version ^3.6.0 for pytest\n\nGenerated file\n\n[project]\nname = "my-package"\nversion = "1.2.3"\ndescription = "This is a description"\nauthors = [\n {name = "Your Name",email = "[email protected]"}\n]\nlicense = {text = "MIT"}\nreadme = "README.md"\nrequires-python = ">=3.6"\ndependencies = ["demo @ file:///tmp/pytest-of-root/pytest-0/popen-gw1/test_interactive_with_file_dep0/demo-0.1.0-py2.py3-none-any.whl"]\n\n[tool.poetry]\n\n[tool.poetry.group.dev.dependencies]\npytest = "^3.6.0"\n\n[build-system]\nrequires = ["poetry-core>=2.0.0,<3.0.0"]\nbuild-backend = "poetry.core.masonry.api"\n\n\n'
E + where '\nThis command will guide you through creating your pyproject.toml config.\n\n\n You can specify a package in the following forms:\n - A single name (requests): this will search for matches on PyPI\n - A name and a constraint (requests@^2.23.0)\n - A git url (git+https://github.com/python-poetry/poetry.git)\n - A git url with a revision (git+https://github.com/python-poetry/poetry.git#develop)\n - A file path (../my-package/my-package.whl)\n - A directory (../my-package/)\n - A url (https://example.com/packages/my-package-0.1.0.tar.gz)\n \nAdding ./demo-0.1.0-py2.py3-none-any.whl\n\nFound 1 packages matching pytest\nUsing version ^3.6.0 for pytest\n\nGenerated file\n\n[project]\nname = "my-package"\nversion = "1.2.3"\ndescription = "This is a description"\nauthors = [\n {name = "Your Name",email = "[email protected]"}\n]\nlicense = {text = "MIT"}\nreadme = "README.md"\nrequires-python = ">=3.6"\ndependencies = ["demo @ file:///tmp/pytest-of-root/pytest-0/popen-gw1/test_interactive_with_file_dep0/demo-0.1.0-py2.py3-none-any.whl"]\n\n[tool.poetry]\n\n[tool.poetry.group.dev.dependencies]\npytest = "^3.6.0"\n\n[build-system]\nrequires = ["poetry-core>=2.0.0,<3.0.0"]\nbuild-backend = "poetry.core.masonry.api"\n\n\n' = fetch_output()
E + where fetch_output = <cleo.io.buffered_io.BufferedIO object at 0x157f6915ead0>.fetch_output
E + where <cleo.io.buffered_io.BufferedIO object at 0x157f6915ead0> = <cleo.testers.command_tester.CommandTester object at 0x157f6915edd0>.io
/tmp/cirrus-ci-build/tests/console/commands/test_init.py:599: AssertionError
Check failure on line 894 in tests/console/commands/test_init.py
cirrus-ci / Tests / FreeBSD (Python 3.11) / pytest
tests/console/commands/test_init.py#L894
tests.console.commands.test_init.test_predefined_all_options
Raw output
tester = <cleo.testers.command_tester.CommandTester object at 0x157f668dc150>
repo = <tests.helpers.TestRepository object at 0x157f69ada8d0>
def test_predefined_all_options(tester: CommandTester, repo: TestRepository) -> None:
repo.add_package(get_package("pendulum", "2.0.0"))
repo.add_package(get_package("pytest", "3.6.0"))
inputs = [
"1.2.3", # Version
"", # Author
"n", # Interactive packages
"n", # Interactive dev packages
"\n", # Generate
]
tester.execute(
"--name my-package "
"--description 'This is a description' "
"--author 'Foo Bar <[email protected]>' "
"--python '>=3.8' "
"--license MIT "
"--dependency pendulum "
"--dev-dependency pytest",
inputs="\n".join(inputs),
)
expected = """\
[project]
name = "my-package"
version = "1.2.3"
description = "This is a description"
authors = [
{name = "Foo Bar",email = "[email protected]"}
]
license = {text = "MIT"}
readme = "README.md"
requires-python = ">=3.8"
dependencies = [
"pendulum (>=2.0.0,<3.0.0)"
]
[tool.poetry]
[tool.poetry.group.dev.dependencies]
pytest = "^3.6.0"
"""
output = tester.io.fetch_output()
> assert expected in output
E assert '[project]\nname = "my-package"\nversion = "1.2.3"\ndescription = "This is a description"\nauthors = [\n {name = "Foo Bar",email = "[email protected]"}\n]\nlicense = {text = "MIT"}\nreadme = "README.md"\nrequires-python = ">=3.8"\ndependencies = [\n "pendulum (>=2.0.0,<3.0.0)"\n]\n\n[tool.poetry]\n\n[tool.poetry.group.dev.dependencies]\npytest = "^3.6.0"\n' in '\nThis command will guide you through creating your pyproject.toml config.\n\n\nUsing version ^2.0.0 for pendulum\nUsing version ^3.6.0 for pytest\nGenerated file\n\n[project]\nname = "my-package"\nversion = "1.2.3"\ndescription = "This is a description"\nauthors = [\n {name = "Foo Bar",email = "[email protected]"}\n]\nlicense = {text = "MIT"}\nreadme = "README.md"\nrequires-python = ">=3.8"\ndependencies = ["pendulum (>=2.0.0,<3.0.0)"]\n\n[tool.poetry]\n\n[tool.poetry.group.dev.dependencies]\npytest = "^3.6.0"\n\n[build-system]\nrequires = ["poetry-core>=2.0.0,<3.0.0"]\nbuild-backend = "poetry.core.masonry.api"\n\n\n'
/tmp/cirrus-ci-build/tests/console/commands/test_init.py:894: AssertionError
Check failure on line 1099 in tests/console/commands/test_init.py
cirrus-ci / Tests / FreeBSD (Python 3.11) / pytest
tests/console/commands/test_init.py#L1099
tests.console.commands.test_init.test_package_include[my.package-my]
Raw output
tester = <cleo.testers.command_tester.CommandTester object at 0x157f657f35d0>
package_name = 'my.package', include = 'my'
@pytest.mark.parametrize(
"package_name, include",
(
("mypackage", None),
("my-package", "my_package"),
("my.package", "my"),
("my-awesome-package", "my_awesome_package"),
("my.awesome.package", "my"),
),
)
def test_package_include(
tester: CommandTester,
package_name: str,
include: str | None,
) -> None:
tester.execute(
inputs="\n".join(
(
package_name,
"", # Version
"", # Description
"poetry", # Author
"", # License
">=3.10", # Python
"n", # Interactive packages
"n", # Interactive dev packages
"\n", # Generate
),
),
)
packages = ""
if include and module_name(package_name) != include:
packages = f'\n[tool.poetry]\npackages = [{{include = "{include}"}}]\n'
expected = (
"[project]\n"
f'name = "{package_name.replace(".", "-")}"\n' # canonicalized
'version = "0.1.0"\n'
'description = ""\n'
"authors = [\n"
' {name = "poetry"}\n'
"]\n"
'readme = "README.md"\n'
'requires-python = ">=3.10"\n'
"dependencies = [\n"
"]\n"
f"{packages}" # This line is optional. Thus, no newline here.
)
> assert expected in tester.io.fetch_output()
E assert '[project]\nname = "my-package"\nversion = "0.1.0"\ndescription = ""\nauthors = [\n {name = "poetry"}\n]\nreadme = "README.md"\nrequires-python = ">=3.10"\ndependencies = [\n]\n\n[tool.poetry]\npackages = [{include = "my"}]\n' in '\nThis command will guide you through creating your pyproject.toml config.\n\n\nGenerated file\n\n[project]\nname = "my-package"\nversion = "0.1.0"\ndescription = ""\nauthors = [\n {name = "poetry"}\n]\nreadme = "README.md"\nrequires-python = ">=3.10"\ndependencies = []\n\n[tool.poetry]\npackages = [{include = "my"}]\n\n\n[build-system]\nrequires = ["poetry-core>=2.0.0,<3.0.0"]\nbuild-backend = "poetry.core.masonry.api"\n\n\n'
E + where '\nThis command will guide you through creating your pyproject.toml config.\n\n\nGenerated file\n\n[project]\nname = "my-package"\nversion = "0.1.0"\ndescription = ""\nauthors = [\n {name = "poetry"}\n]\nreadme = "README.md"\nrequires-python = ">=3.10"\ndependencies = []\n\n[tool.poetry]\npackages = [{include = "my"}]\n\n\n[build-system]\nrequires = ["poetry-core>=2.0.0,<3.0.0"]\nbuild-backend = "poetry.core.masonry.api"\n\n\n' = fetch_output()
E + where fetch_output = <cleo.io.buffered_io.BufferedIO object at 0x157f657f1d90>.fetch_output
E + where <cleo.io.buffered_io.BufferedIO object at 0x157f657f1d90> = <cleo.testers.command_tester.CommandTester object at 0x157f657f35d0>.io
/tmp/cirrus-ci-build/tests/console/commands/test_init.py:1099: AssertionError
Check failure on line 755 in tests/console/commands/test_init.py
cirrus-ci / Tests / FreeBSD (Python 3.11) / pytest
tests/console/commands/test_init.py#L755
tests.console.commands.test_init.test_predefined_and_interactive_dependencies
Raw output
tester = <cleo.testers.command_tester.CommandTester object at 0x157f6969ed90>
repo = <tests.helpers.TestRepository object at 0x157f6a935410>
def test_predefined_and_interactive_dependencies(
tester: CommandTester, repo: TestRepository
) -> None:
repo.add_package(get_package("pendulum", "2.0.0"))
repo.add_package(get_package("pyramid", "1.10"))
inputs = [
"my-package", # Package name
"1.2.3", # Version
"This is a description", # Description
"n", # Author
"MIT", # License
">=3.6", # Python
"", # Interactive packages
"pyramid", # Search for package
"0", # First option
"", # Do not set constraint
"", # Stop searching for packages
"n", # Interactive dev packages
"\n", # Generate
]
tester.execute("--dependency pendulum", inputs="\n".join(inputs))
expected = """\
[project]
name = "my-package"
version = "1.2.3"
description = "This is a description"
authors = [
{name = "Your Name",email = "[email protected]"}
]
license = {text = "MIT"}
readme = "README.md"
requires-python = ">=3.6"
dependencies = [
"pendulum (>=2.0.0,<3.0.0)",
"pyramid (>=1.10,<2.0)"
]
"""
> assert expected in tester.io.fetch_output()
E assert '[project]\nname = "my-package"\nversion = "1.2.3"\ndescription = "This is a description"\nauthors = [\n {name = "Your Name",email = "[email protected]"}\n]\nlicense = {text = "MIT"}\nreadme = "README.md"\nrequires-python = ">=3.6"\ndependencies = [\n "pendulum (>=2.0.0,<3.0.0)",\n "pyramid (>=1.10,<2.0)"\n]\n' in '\nThis command will guide you through creating your pyproject.toml config.\n\n\nUsing version ^2.0.0 for pendulum\n You can specify a package in the following forms:\n - A single name (requests): this will search for matches on PyPI\n - A name and a constraint (requests@^2.23.0)\n - A git url (git+https://github.com/python-poetry/poetry.git)\n - A git url with a revision (git+https://github.com/python-poetry/poetry.git#develop)\n - A file path (../my-package/my-package.whl)\n - A directory (../my-package/)\n - A url (https://example.com/packages/my-package-0.1.0.tar.gz)\n \nFound 1 packages matching pyramid\nUsing version ^1.10 for pyramid\n\nGenerated file\n\n[project]\nname = "my-package"\nversion = "1.2.3"\ndescription = "This is a description"\nauthors = [\n {name = "Your Name",email = "[email protected]"}\n]\nlicense = {text = "MIT"}\nreadme = "README.md"\nrequires-python = ">=3.6"\ndependencies = ["pendulum (>=2.0.0,<3.0.0)", "pyramid (>=1.10,<2.0)"]\n\n\n[build-system]\nrequires = ["poetry-core>=2.0.0,<3.0.0"]\nbuild-backend = "poetry.core.masonry.api"\n\n\n'
E + where '\nThis command will guide you through creating your pyproject.toml config.\n\n\nUsing version ^2.0.0 for pendulum\n You can specify a package in the following forms:\n - A single name (requests): this will search for matches on PyPI\n - A name and a constraint (requests@^2.23.0)\n - A git url (git+https://github.com/python-poetry/poetry.git)\n - A git url with a revision (git+https://github.com/python-poetry/poetry.git#develop)\n - A file path (../my-package/my-package.whl)\n - A directory (../my-package/)\n - A url (https://example.com/packages/my-package-0.1.0.tar.gz)\n \nFound 1 packages matching pyramid\nUsing version ^1.10 for pyramid\n\nGenerated file\n\n[project]\nname = "my-package"\nversion = "1.2.3"\ndescription = "This is a description"\nauthors = [\n {name = "Your Name",email = "[email protected]"}\n]\nlicense = {text = "MIT"}\nreadme = "README.md"\nrequires-python = ">=3.6"\ndependencies = ["pendulum (>=2.0.0,<3.0.0)", "pyramid (>=1.10,<2.0)"]\n\n\n[build-system]\nrequires = ["poetry-core>=2.0.0,<3.0.0"]\nbuild-backend = "poetry.core.masonry.api"\n\n\n' = fetch_output()
E + where fetch_output = <cleo.io.buffered_io.BufferedIO object at 0x157f6969e6d0>.fetch_output
E + where <cleo.io.buffered_io.BufferedIO object at 0x157f6969e6d0> = <cleo.testers.command_tester.CommandTester object at 0x157f6969ed90>.io
/tmp/cirrus-ci-build/tests/console/commands/test_init.py:755: AssertionError
Check failure on line 844 in tests/console/commands/test_init.py
cirrus-ci / Tests / FreeBSD (Python 3.11) / pytest
tests/console/commands/test_init.py#L844
tests.console.commands.test_init.test_predefined_and_interactive_dev_dependencies
Raw output
tester = <cleo.testers.command_tester.CommandTester object at 0x157f69aab1d0>
repo = <tests.helpers.TestRepository object at 0x157f699f1c50>
def test_predefined_and_interactive_dev_dependencies(
tester: CommandTester, repo: TestRepository
) -> None:
repo.add_package(get_package("pytest", "3.6.0"))
repo.add_package(get_package("pytest-requests", "0.2.0"))
inputs = [
"my-package", # Package name
"1.2.3", # Version
"This is a description", # Description
"n", # Author
"MIT", # License
">=3.6", # Python
"n", # Interactive packages
"", # Interactive dev packages
"pytest-requests", # Search for package
"0", # Select first option
"", # Do not set constraint
"", # Stop searching for dev packages
"\n", # Generate
]
tester.execute("--dev-dependency pytest", inputs="\n".join(inputs))
expected = """\
[project]
name = "my-package"
version = "1.2.3"
description = "This is a description"
authors = [
{name = "Your Name",email = "[email protected]"}
]
license = {text = "MIT"}
readme = "README.md"
requires-python = ">=3.6"
dependencies = [
]
[tool.poetry]
[tool.poetry.group.dev.dependencies]
pytest = "^3.6.0"
pytest-requests = "^0.2.0"
"""
output = tester.io.fetch_output()
> assert expected in output
E assert '[project]\nname = "my-package"\nversion = "1.2.3"\ndescription = "This is a description"\nauthors = [\n {name = "Your Name",email = "[email protected]"}\n]\nlicense = {text = "MIT"}\nreadme = "README.md"\nrequires-python = ">=3.6"\ndependencies = [\n]\n\n[tool.poetry]\n\n[tool.poetry.group.dev.dependencies]\npytest = "^3.6.0"\npytest-requests = "^0.2.0"\n' in '\nThis command will guide you through creating your pyproject.toml config.\n\n\nUsing version ^3.6.0 for pytest\n You can specify a package in the following forms:\n - A single name (requests): this will search for matches on PyPI\n - A name and a constraint (requests@^2.23.0)\n - A git url (git+https://github.com/python-poetry/poetry.git)\n - A git url with a revision (git+https://github.com/python-poetry/poetry.git#develop)\n - A file path (../my-package/my-package.whl)\n - A directory (../my-package/)\n - A url (https://example.com/packages/my-package-0.1.0.tar.gz)\n \nFound 1 packages matching pytest-requests\nUsing version ^0.2.0 for pytest-requests\n\nGenerated file\n\n[project]\nname = "my-package"\nversion = "1.2.3"\ndescription = "This is a description"\nauthors = [\n {name = "Your Name",email = "[email protected]"}\n]\nlicense = {text = "MIT"}\nreadme = "README.md"\nrequires-python = ">=3.6"\ndependencies = []\n\n[tool.poetry]\n\n[tool.poetry.group.dev.dependencies]\npytest = "^3.6.0"\npytest-requests = "^0.2.0"\n\n[build-system]\nrequires = ["poetry-core>=2.0.0,<3.0.0"]\nbuild-backend = "poetry.core.masonry.api"\n\n\n'
/tmp/cirrus-ci-build/tests/console/commands/test_init.py:844: AssertionError
Check failure on line 712 in tests/console/commands/test_init.py
cirrus-ci / Tests / FreeBSD (Python 3.11) / pytest
tests/console/commands/test_init.py#L712
tests.console.commands.test_init.test_predefined_dependency
Raw output
tester = <cleo.testers.command_tester.CommandTester object at 0x31c0b8c88750>
repo = <tests.helpers.TestRepository object at 0x31c0b7362410>
def test_predefined_dependency(tester: CommandTester, repo: TestRepository) -> None:
repo.add_package(get_package("pendulum", "2.0.0"))
inputs = [
"my-package", # Package name
"1.2.3", # Version
"This is a description", # Description
"n", # Author
"MIT", # License
">=3.6", # Python
"n", # Interactive packages
"n", # Interactive dev packages
"\n", # Generate
]
tester.execute("--dependency pendulum", inputs="\n".join(inputs))
expected = """\
[project]
name = "my-package"
version = "1.2.3"
description = "This is a description"
authors = [
{name = "Your Name",email = "[email protected]"}
]
license = {text = "MIT"}
readme = "README.md"
requires-python = ">=3.6"
dependencies = [
"pendulum (>=2.0.0,<3.0.0)"
]
"""
> assert expected in tester.io.fetch_output()
E assert '[project]\nname = "my-package"\nversion = "1.2.3"\ndescription = "This is a description"\nauthors = [\n {name = "Your Name",email = "[email protected]"}\n]\nlicense = {text = "MIT"}\nreadme = "README.md"\nrequires-python = ">=3.6"\ndependencies = [\n "pendulum (>=2.0.0,<3.0.0)"\n]\n' in '\nThis command will guide you through creating your pyproject.toml config.\n\n\nUsing version ^2.0.0 for pendulum\nGenerated file\n\n[project]\nname = "my-package"\nversion = "1.2.3"\ndescription = "This is a description"\nauthors = [\n {name = "Your Name",email = "[email protected]"}\n]\nlicense = {text = "MIT"}\nreadme = "README.md"\nrequires-python = ">=3.6"\ndependencies = ["pendulum (>=2.0.0,<3.0.0)"]\n\n\n[build-system]\nrequires = ["poetry-core>=2.0.0,<3.0.0"]\nbuild-backend = "poetry.core.masonry.api"\n\n\n'
E + where '\nThis command will guide you through creating your pyproject.toml config.\n\n\nUsing version ^2.0.0 for pendulum\nGenerated file\n\n[project]\nname = "my-package"\nversion = "1.2.3"\ndescription = "This is a description"\nauthors = [\n {name = "Your Name",email = "[email protected]"}\n]\nlicense = {text = "MIT"}\nreadme = "README.md"\nrequires-python = ">=3.6"\ndependencies = ["pendulum (>=2.0.0,<3.0.0)"]\n\n\n[build-system]\nrequires = ["poetry-core>=2.0.0,<3.0.0"]\nbuild-backend = "poetry.core.masonry.api"\n\n\n' = fetch_output()
E + where fetch_output = <cleo.io.buffered_io.BufferedIO object at 0x31c0b8c89c50>.fetch_output
E + where <cleo.io.buffered_io.BufferedIO object at 0x31c0b8c89c50> = <cleo.testers.command_tester.CommandTester object at 0x31c0b8c88750>.io
/tmp/cirrus-ci-build/tests/console/commands/test_init.py:712: AssertionError
Check failure on line 795 in tests/console/commands/test_init.py
cirrus-ci / Tests / FreeBSD (Python 3.11) / pytest
tests/console/commands/test_init.py#L795
tests.console.commands.test_init.test_predefined_dev_dependency
Raw output
tester = <cleo.testers.command_tester.CommandTester object at 0x31c0b4acee10>
repo = <tests.helpers.TestRepository object at 0x31c0b5cda810>
def test_predefined_dev_dependency(tester: CommandTester, repo: TestRepository) -> None:
repo.add_package(get_package("pytest", "3.6.0"))
inputs = [
"my-package", # Package name
"1.2.3", # Version
"This is a description", # Description
"n", # Author
"MIT", # License
">=3.6", # Python
"n", # Interactive packages
"n", # Interactive dev packages
"\n", # Generate
]
tester.execute("--dev-dependency pytest", inputs="\n".join(inputs))
expected = """\
[project]
name = "my-package"
version = "1.2.3"
description = "This is a description"
authors = [
{name = "Your Name",email = "[email protected]"}
]
license = {text = "MIT"}
readme = "README.md"
requires-python = ">=3.6"
dependencies = [
]
[tool.poetry]
[tool.poetry.group.dev.dependencies]
pytest = "^3.6.0"
"""
> assert expected in tester.io.fetch_output()
E assert '[project]\nname = "my-package"\nversion = "1.2.3"\ndescription = "This is a description"\nauthors = [\n {name = "Your Name",email = "[email protected]"}\n]\nlicense = {text = "MIT"}\nreadme = "README.md"\nrequires-python = ">=3.6"\ndependencies = [\n]\n\n[tool.poetry]\n\n[tool.poetry.group.dev.dependencies]\npytest = "^3.6.0"\n' in '\nThis command will guide you through creating your pyproject.toml config.\n\n\nUsing version ^3.6.0 for pytest\nGenerated file\n\n[project]\nname = "my-package"\nversion = "1.2.3"\ndescription = "This is a description"\nauthors = [\n {name = "Your Name",email = "[email protected]"}\n]\nlicense = {text = "MIT"}\nreadme = "README.md"\nrequires-python = ">=3.6"\ndependencies = []\n\n[tool.poetry]\n\n[tool.poetry.group.dev.dependencies]\npytest = "^3.6.0"\n\n[build-system]\nrequires = ["poetry-core>=2.0.0,<3.0.0"]\nbuild-backend = "poetry.core.masonry.api"\n\n\n'
E + where '\nThis command will guide you through creating your pyproject.toml config.\n\n\nUsing version ^3.6.0 for pytest\nGenerated file\n\n[project]\nname = "my-package"\nversion = "1.2.3"\ndescription = "This is a description"\nauthors = [\n {name = "Your Name",email = "[email protected]"}\n]\nlicense = {text = "MIT"}\nreadme = "README.md"\nrequires-python = ">=3.6"\ndependencies = []\n\n[tool.poetry]\n\n[tool.poetry.group.dev.dependencies]\npytest = "^3.6.0"\n\n[build-system]\nrequires = ["poetry-core>=2.0.0,<3.0.0"]\nbuild-backend = "poetry.core.masonry.api"\n\n\n' = fetch_output()
E + where fetch_output = <cleo.io.buffered_io.BufferedIO object at 0x31c0b4acec90>.fetch_output
E + where <cleo.io.buffered_io.BufferedIO object at 0x31c0b4acec90> = <cleo.testers.command_tester.CommandTester object at 0x31c0b4acee10>.io
/tmp/cirrus-ci-build/tests/console/commands/test_init.py:795: AssertionError
Check failure on line 383 in tests/console/commands/test_init.py
cirrus-ci / Tests / FreeBSD (Python 3.11) / pytest
tests/console/commands/test_init.py#L383
tests.console.commands.test_init.test_interactive_with_git_dependencies_with_reference
Raw output
tester = <cleo.testers.command_tester.CommandTester object at 0x157f69cd2f90>
repo = <tests.helpers.TestRepository object at 0x157f69c54910>
def test_interactive_with_git_dependencies_with_reference(
tester: CommandTester, repo: TestRepository
) -> None:
repo.add_package(get_package("pendulum", "2.0.0"))
repo.add_package(get_package("pytest", "3.6.0"))
inputs = [
"my-package", # Package name
"1.2.3", # Version
"This is a description", # Description
"n", # Author
"MIT", # License
">=3.6", # Python
"", # Interactive packages
"git+https://github.com/demo/demo.git@develop", # Search for package
"", # Stop searching for packages
"", # Interactive dev packages
"pytest", # Search for package
"0",
"",
"",
"\n", # Generate
]
tester.execute(inputs="\n".join(inputs))
expected = """\
[project]
name = "my-package"
version = "1.2.3"
description = "This is a description"
authors = [
{name = "Your Name",email = "[email protected]"}
]
license = {text = "MIT"}
readme = "README.md"
requires-python = ">=3.6"
dependencies = [
"demo @ git+https://github.com/demo/demo.git@develop"
]
[tool.poetry]
[tool.poetry.group.dev.dependencies]
pytest = "^3.6.0"
"""
> assert expected in tester.io.fetch_output()
E assert '[project]\nname = "my-package"\nversion = "1.2.3"\ndescription = "This is a description"\nauthors = [\n {name = "Your Name",email = "[email protected]"}\n]\nlicense = {text = "MIT"}\nreadme = "README.md"\nrequires-python = ">=3.6"\ndependencies = [\n "demo @ git+https://github.com/demo/demo.git@develop"\n]\n\n[tool.poetry]\n\n[tool.poetry.group.dev.dependencies]\npytest = "^3.6.0"\n' in '\nThis command will guide you through creating your pyproject.toml config.\n\n\n You can specify a package in the following forms:\n - A single name (requests): this will search for matches on PyPI\n - A name and a constraint (requests@^2.23.0)\n - A git url (git+https://github.com/python-poetry/poetry.git)\n - A git url with a revision (git+https://github.com/python-poetry/poetry.git#develop)\n - A file path (../my-package/my-package.whl)\n - A directory (../my-package/)\n - A url (https://example.com/packages/my-package-0.1.0.tar.gz)\n \nAdding git+https://github.com/demo/demo.git@develop\n\nFound 1 packages matching pytest\nUsing version ^3.6.0 for pytest\n\nGenerated file\n\n[project]\nname = "my-package"\nversion = "1.2.3"\ndescription = "This is a description"\nauthors = [\n {name = "Your Name",email = "[email protected]"}\n]\nlicense = {text = "MIT"}\nreadme = "README.md"\nrequires-python = ">=3.6"\ndependencies = ["demo @ git+https://github.com/demo/demo.git@develop"]\n\n[tool.poetry]\n\n[tool.poetry.group.dev.dependencies]\npytest = "^3.6.0"\n\n[build-system]\nrequires = ["poetry-core>=2.0.0,<3.0.0"]\nbuild-backend = "poetry.core.masonry.api"\n\n\n'
E + where '\nThis command will guide you through creating your pyproject.toml config.\n\n\n You can specify a package in the following forms:\n - A single name (requests): this will search for matches on PyPI\n - A name and a constraint (requests@^2.23.0)\n - A git url (git+https://github.com/python-poetry/poetry.git)\n - A git url with a revision (git+https://github.com/python-poetry/poetry.git#develop)\n - A file path (../my-package/my-package.whl)\n - A directory (../my-package/)\n - A url (https://example.com/packages/my-package-0.1.0.tar.gz)\n \nAdding git+https://github.com/demo/demo.git@develop\n\nFound 1 packages matching pytest\nUsing version ^3.6.0 for pytest\n\nGenerated file\n\n[project]\nname = "my-package"\nversion = "1.2.3"\ndescription = "This is a description"\nauthors = [\n {name = "Your Name",email = "[email protected]"}\n]\nlicense = {text = "MIT"}\nreadme = "README.md"\nrequires-python = ">=3.6"\ndependencies = ["demo @ git+https://github.com/demo/demo.git@develop"]\n\n[tool.poetry]\n\n[tool.poetry.group.dev.dependencies]\npytest = "^3.6.0"\n\n[build-system]\nrequires = ["poetry-core>=2.0.0,<3.0.0"]\nbuild-backend = "poetry.core.masonry.api"\n\n\n' = fetch_output()
E + where fetch_output = <cleo.io.buffered_io.BufferedIO object at 0x157f69cd3e90>.fetch_output
E + where <cleo.io.buffered_io.BufferedIO object at 0x157f69cd3e90> = <cleo.testers.command_tester.CommandTester object at 0x157f69cd2f90>.io
/tmp/cirrus-ci-build/tests/console/commands/test_init.py:383: AssertionError
Check failure on line 236 in tests/console/commands/test_new.py
cirrus-ci / Tests / FreeBSD (Python 3.11) / pytest
tests/console/commands/test_new.py#L236
tests.console.commands.test_new.test_basic_interactive_new
Raw output
tester = <cleo.testers.command_tester.CommandTester object at 0x31c0b73fb510>
tmp_path = PosixPath('/tmp/pytest-of-root/pytest-0/popen-gw0/test_basic_interactive_new0')
init_basic_inputs = 'my-package\n1.2.3\nThis is a description\nn\nMIT\n>=3.6\nn\nn\n\n'
new_basic_toml = '[project]\nname = "my-package"\nversion = "1.2.3"\ndescription = "This is a description"\nauthors = [\n {name = "Y...requires-python = ">=3.6"\ndependencies = [\n]\n\n[tool.poetry]\npackages = [{include = "my_package", from = "src"}]\n'
def test_basic_interactive_new(
tester: CommandTester, tmp_path: Path, init_basic_inputs: str, new_basic_toml: str
) -> None:
path = tmp_path / "somepackage"
tester.execute(f"--interactive {path.as_posix()}", inputs=init_basic_inputs)
verify_project_directory(path, "my-package", "src/my_package")
> assert new_basic_toml in tester.io.fetch_output()
E assert '[project]\nname = "my-package"\nversion = "1.2.3"\ndescription = "This is a description"\nauthors = [\n {name = "Your Name",email = "[email protected]"}\n]\nlicense = {text = "MIT"}\nreadme = "README.md"\nrequires-python = ">=3.6"\ndependencies = [\n]\n\n[tool.poetry]\npackages = [{include = "my_package", from = "src"}]\n' in '\nThis command will guide you through creating your pyproject.toml config.\n\n\nGenerated file\n\n[project]\nname = "my-package"\nversion = "1.2.3"\ndescription = "This is a description"\nauthors = [\n {name = "Your Name",email = "[email protected]"}\n]\nlicense = {text = "MIT"}\nreadme = "README.md"\nrequires-python = ">=3.6"\ndependencies = []\n\n[tool.poetry]\npackages = [{include = "my_package", from = "src"}]\n\n\n[build-system]\nrequires = ["poetry-core>=2.0.0,<3.0.0"]\nbuild-backend = "poetry.core.masonry.api"\n\n\nCreated package my_package in somepackage\n'
E + where '\nThis command will guide you through creating your pyproject.toml config.\n\n\nGenerated file\n\n[project]\nname = "my-package"\nversion = "1.2.3"\ndescription = "This is a description"\nauthors = [\n {name = "Your Name",email = "[email protected]"}\n]\nlicense = {text = "MIT"}\nreadme = "README.md"\nrequires-python = ">=3.6"\ndependencies = []\n\n[tool.poetry]\npackages = [{include = "my_package", from = "src"}]\n\n\n[build-system]\nrequires = ["poetry-core>=2.0.0,<3.0.0"]\nbuild-backend = "poetry.core.masonry.api"\n\n\nCreated package my_package in somepackage\n' = fetch_output()
E + where fetch_output = <cleo.io.buffered_io.BufferedIO object at 0x31c0b7168850>.fetch_output
E + where <cleo.io.buffered_io.BufferedIO object at 0x31c0b7168850> = <cleo.testers.command_tester.CommandTester object at 0x31c0b73fb510>.io
/tmp/cirrus-ci-build/tests/console/commands/test_new.py:236: AssertionError